File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.jetbrains.kotlinx.dataframe.api
2
2
3
3
import io.kotest.matchers.shouldBe
4
4
import org.jetbrains.kotlinx.dataframe.DataFrame
5
+ import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
5
6
import org.junit.Test
6
7
7
8
class UpdateTests {
@@ -12,4 +13,32 @@ class UpdateTests {
12
13
val col by column<Int >()
13
14
df.update { col }.with { 2 } shouldBe df
14
15
}
16
+
17
+ @DataSchema
18
+ interface SchemaA {
19
+ val i: Int?
20
+ }
21
+
22
+ @DataSchema
23
+ interface SchemaB {
24
+ val i: Int
25
+ }
26
+
27
+ @Test
28
+ fun `fillNulls update` () {
29
+ val df = dataFrameOf(" i" )(1 , null )
30
+
31
+ df.fillNulls(SchemaA ::i).with { 42 }
32
+
33
+ df.fillNulls(SchemaB ::i).with { 42 }
34
+ }
35
+
36
+ @Test
37
+ fun `fillNA update` () {
38
+ val df = dataFrameOf(" i" )(1 , null )
39
+
40
+ df.fillNA(SchemaA ::i).with { 42 }
41
+
42
+ df.fillNA(SchemaB ::i).with { 42 }
43
+ }
15
44
}
You can’t perform that action at this time.
0 commit comments