Skip to content

Commit e2e035f

Browse files
committed
added tests for fillNulls and fillNA updates
1 parent b59cfb6 commit e2e035f

File tree

1 file changed

+29
-0
lines changed
  • core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+29
-0
lines changed

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.jetbrains.kotlinx.dataframe.api
22

33
import io.kotest.matchers.shouldBe
44
import org.jetbrains.kotlinx.dataframe.DataFrame
5+
import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
56
import org.junit.Test
67

78
class UpdateTests {
@@ -12,4 +13,32 @@ class UpdateTests {
1213
val col by column<Int>()
1314
df.update { col }.with { 2 } shouldBe df
1415
}
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+
}
1544
}

0 commit comments

Comments
 (0)