@@ -22,6 +22,7 @@ import org.jetbrains.kotlinx.dataframe.api.remove
2222import org.jetbrains.kotlinx.dataframe.api.rightJoinWith
2323import org.jetbrains.kotlinx.dataframe.api.select
2424import org.junit.Test
25+ import kotlin.reflect.typeOf
2526
2627@Suppress(" ktlint:standard:argument-list-wrapping" )
2728class JoinWithTests : BaseJoinTest () {
@@ -34,9 +35,12 @@ class JoinWithTests : BaseJoinTest() {
3435 res.columnsCount() shouldBe 8
3536 res.rowsCount() shouldBe 7
3637 res[" age1" ].hasNulls() shouldBe false
38+ res[" age1" ].type() shouldBe typeOf<String >()
39+ res[" age1" ].values().all { it != null } shouldBe true
3740 res.count { name == " Charlie" && city == " Moscow" } shouldBe 4
3841 res.select { city and name }.distinct().rowsCount() shouldBe 3
3942 res[Person2 ::grade].hasNulls() shouldBe false
43+ res.age.type() shouldBe typeOf<Int >()
4044 }
4145
4246 @Test
@@ -49,6 +53,8 @@ class JoinWithTests : BaseJoinTest() {
4953 res.select { city and name }.distinct().rowsCount() shouldBe 6
5054 res.count { it[" grade" ] == null } shouldBe 3
5155 res.age.hasNulls() shouldBe false
56+ res.age.type() shouldBe typeOf<Int >()
57+ res[" age1" ].type() shouldBe typeOf<String ?>()
5258 }
5359
5460 @Test
@@ -62,6 +68,7 @@ class JoinWithTests : BaseJoinTest() {
6268 res.select { city and name }.distinct().rowsCount() shouldBe 4
6369 res[Person2 ::grade].hasNulls() shouldBe false
6470 res.age.hasNulls() shouldBe true
71+ res.age.type() shouldBe typeOf<Int ?>()
6572 val newEntries = res.filter { it[" age" ] == null }
6673 newEntries.rowsCount() shouldBe 2
6774 newEntries.all { it[" name1" ] == " Bob" && it[" origin" ] == " Paris" && weight == null } shouldBe true
@@ -78,6 +85,8 @@ class JoinWithTests : BaseJoinTest() {
7885 val distinct = res.select { name and age and city and weight }.distinct()
7986 val expected = typed.append(null , null , null , null )
8087 distinct shouldBe expected
88+ res.age.type() shouldBe typeOf<Int ?>()
89+ res[" age1" ].type() shouldBe typeOf<String ?>()
8190 }
8291
8392 @Test
@@ -103,7 +112,7 @@ class JoinWithTests : BaseJoinTest() {
103112 }
104113
105114 @Test
106- fun rightJoin () {
115+ fun `exclude join` () {
107116 val df = dataFrameOf(" a" , " b" )(
108117 1 , " a" ,
109118 2 , " b" ,
@@ -116,7 +125,17 @@ class JoinWithTests : BaseJoinTest() {
116125 2 , " II" ,
117126 3 , " III" ,
118127 )
128+
119129 df.append(4 , " e" ).excludeJoin(df1).print ()
130+
131+ val res = df.append(4 , " e" ).excludeJoin(df1)
132+
133+ res.rowsCount() shouldBe 1
134+ res[" a" ].values() shouldBe listOf (4 )
135+ res[" b" ].values() shouldBe listOf (" e" )
136+ res.columnsCount() shouldBe 2
137+ res[" a" ].type() shouldBe typeOf<Int >()
138+ res[" b" ].type() shouldBe typeOf<String >()
120139 }
121140
122141 @Test
0 commit comments