Skip to content

Commit 7c41875

Browse files
committed
removed ColumnPath overloads, fixed groups, added docs for allRec and rec
1 parent f94b252 commit 7c41875

File tree

6 files changed

+497
-792
lines changed

6 files changed

+497
-792
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt

Lines changed: 338 additions & 605 deletions
Large diffs are not rendered by default.

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,13 @@ open class ColumnsSelectionDslTests : TestBase() {
491491
// df.select { it["name"][0..1] },
492492
).shouldAllBeEqual()
493493
}
494+
495+
@Test
496+
fun roots() {
497+
df.select { cols(name.firstName, name.lastName, age).roots() } shouldBe
498+
df.select { cols(name.firstName, name.lastName, age) }
499+
500+
df.select { cols(name.firstName, name.lastName, age, name).roots() } shouldBe
501+
df.select { cols(name, age) }
502+
}
494503
}

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/recursively.kt

Lines changed: 14 additions & 11 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 io.kotest.matchers.shouldNotBe
5+
import org.jetbrains.kotlinx.dataframe.alsoDebug
56
import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath
67
import org.jetbrains.kotlinx.dataframe.samples.api.TestBase
78
import org.jetbrains.kotlinx.dataframe.samples.api.city
@@ -61,18 +62,20 @@ class Recursively : TestBase() {
6162
dfGroup.getColumnsWithPaths { name.children() }.print()
6263
}
6364

65+
@Test
66+
fun `groups`() {
67+
listOf(
68+
df.select { name },
69+
df.select { groups().recursively() },
70+
df.select { groups() },
71+
df.select { all().groups() },
72+
df.select { all().groups().rec() },
73+
).shouldAllBeEqual()
6474

65-
// @Test
66-
// fun `combination`() {
67-
// dfGroup.getColumnsWithPaths {
68-
// cols { it.name in listOf("name", "firstName") }
69-
// .last().recursively()
70-
// } shouldNotBe
71-
// dfGroup.getColumnsWithPaths {
72-
// cols { it.name in listOf("name", "firstName") }.recursively()
73-
// .last().recursively()
74-
// }
75-
// }
75+
dfGroup.select { groups() } shouldBe dfGroup.select { name }
76+
dfGroup.select { groups().rec() } shouldBe dfGroup.select { name and name.firstName }
77+
dfGroup.select { groups().rec(includeTopLevel = false) } shouldBe dfGroup.select { name.firstName }
78+
}
7679

7780
@Test
7881
fun `all recursively`() {

0 commit comments

Comments
 (0)