Skip to content

Commit b40c54a

Browse files
committed
fixed tests and updated docs
1 parent b1e3707 commit b40c54a

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ class Access : TestBase() {
630630
df.select { age and name }
631631
df.fillNaNs { dfsOf<Double>() }.withZero()
632632
df.remove { cols { it.hasNulls() } }
633+
df.group { cols { it.data != name } }.into { "nameless" }
633634
df.update { city }.notNull { it.lowercase() }
634635
df.gather { colsOf<Number>() }.into("key", "value")
635636
df.move { name.firstName and name.lastName }.after { city }
@@ -790,6 +791,7 @@ class Access : TestBase() {
790791

791792
@Test
792793
fun columnSelectorsMisc() {
794+
val df = df.add { "year" from { 0 } }
793795
// SampleStart
794796
// by condition
795797
df.select { cols { it.name().startsWith("year") } }
@@ -813,7 +815,7 @@ class Access : TestBase() {
813815
df.select { dropLast(2) }
814816

815817
// find the first column satisfying the condition
816-
df.select { first { it.name().startsWith("year") } }
818+
df.select { first { it.name.startsWith("year") } }
817819

818820
// find the last column inside a column group satisfying the condition
819821
df.select {

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/DataFrameTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ class DataFrameTests : BaseTest() {
13951395
).toDataFrame().cast<Person>()
13961396
res shouldBe typed
13971397
}
1398-
typed.group { cols { it != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1398+
typed.group { cols { it.data != name } }.into { it.type.jvmErasure.simpleName!! }.check()
13991399
typed.group { age and city and weight }.into { it.type.jvmErasure.simpleName!! }.check()
14001400
}
14011401

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ class Access : TestBase() {
630630
df.select { age and name }
631631
df.fillNaNs { dfsOf<Double>() }.withZero()
632632
df.remove { cols { it.hasNulls() } }
633+
df.group { cols { it.data != name } }.into { "nameless" }
633634
df.update { city }.notNull { it.lowercase() }
634635
df.gather { colsOf<Number>() }.into("key", "value")
635636
df.move { name.firstName and name.lastName }.after { city }
@@ -790,6 +791,7 @@ class Access : TestBase() {
790791

791792
@Test
792793
fun columnSelectorsMisc() {
794+
val df = df.add { "year" from { 0 } }
793795
// SampleStart
794796
// by condition
795797
df.select { cols { it.name().startsWith("year") } }
@@ -813,7 +815,7 @@ class Access : TestBase() {
813815
df.select { dropLast(2) }
814816

815817
// find the first column satisfying the condition
816-
df.select { first { it.name().startsWith("year") } }
818+
df.select { first { it.name.startsWith("year") } }
817819

818820
// find the last column inside a column group satisfying the condition
819821
df.select {

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/DataFrameTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ class DataFrameTests : BaseTest() {
13951395
).toDataFrame().cast<Person>()
13961396
res shouldBe typed
13971397
}
1398-
typed.group { cols { it != name } }.into { it.type.jvmErasure.simpleName!! }.check()
1398+
typed.group { cols { it.data != name } }.into { it.type.jvmErasure.simpleName!! }.check()
13991399
typed.group { age and city and weight }.into { it.type.jvmErasure.simpleName!! }.check()
14001400
}
14011401

docs/StardustDocs/topics/ColumnSelectors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Column selectors are used in many operations:
1212
df.select { age and name }
1313
df.fillNaNs { dfsOf<Double>() }.withZero()
1414
df.remove { cols { it.hasNulls() } }
15+
df.group { cols { it.data != name } }.into { "nameless" }
1516
df.update { city }.notNull { it.lowercase() }
1617
df.gather { colsOf<Number>() }.into("key", "value")
1718
df.move { name.firstName and name.lastName }.after { city }
@@ -207,7 +208,7 @@ df.select { drop(2) }
207208
df.select { dropLast(2) }
208209

209210
// find the first column satisfying the condition
210-
df.select { first { it.name().startsWith("year") } }
211+
df.select { first { it.name.startsWith("year") } }
211212

212213
// find the last column inside a column group satisfying the condition
213214
df.select {

0 commit comments

Comments
 (0)