Skip to content

Commit 06ccc7b

Browse files
committed
removing includeGroups param from recursively
1 parent b4484f5 commit 06ccc7b

File tree

38 files changed

+64
-98
lines changed

38 files changed

+64
-98
lines changed

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,6 @@ public interface ColumnsSelectionDsl<out T> : ColumnSelectionDsl<T>, SingleColum
39513951
*
39523952
* {@includeArg [CommonRecursivelyDocs.Examples]}
39533953
*
3954-
* @param [includeGroups\] Whether to include [column groups][ColumnGroup] in the result. `true` by default.
39553954
* @param [includeTopLevel\] Whether to include the top-level columns in the result. `true` by default.
39563955
*/
39573956
private interface CommonRecursivelyDocs {
@@ -3985,17 +3984,15 @@ public interface ColumnsSelectionDsl<out T> : ColumnSelectionDsl<T>, SingleColum
39853984
*
39863985
* `df.`[select][DataFrame.select]` { `[colsOf][ColumnSet.colsOf]`<`[String][String]`>().`[recursively][recursively]`() }`
39873986
*
3988-
* `df.`[select][DataFrame.select]` { myColumnGroup.`[all][ColumnSet.all]`().`[rec][rec]`(includeGroups = false) }`
3987+
* `df.`[select][DataFrame.select]` { myColumnGroup.`[all][ColumnSet.all]`().`[rec][rec]`() }`
39893988
*
39903989
* `df.`[select][DataFrame.select]` { `[groups][ColumnSet.groups]`().`[recursively][recursively]`(includeTopLevel = false) }`
39913990
*
3992-
* @param [includeGroups] Whether to include [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] in the result. `true` by default.
39933991
* @param [includeTopLevel] Whether to include the top-level columns in the result. `true` by default.
39943992
*/
39953993
public fun <C> TransformableColumnSet<C>.recursively(
3996-
includeGroups: Boolean = true,
39973994
includeTopLevel: Boolean = true,
3998-
): ColumnSet<C> = recursivelyImpl(includeTopLevel = includeTopLevel, includeGroups = includeGroups)
3995+
): ColumnSet<C> = recursivelyImpl(includeTopLevel = includeTopLevel, includeGroups = true)
39993996

40003997
/** ## Recursively / Rec
40013998
*
@@ -4021,17 +4018,15 @@ public interface ColumnsSelectionDsl<out T> : ColumnSelectionDsl<T>, SingleColum
40214018
*
40224019
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.colsOf]`<`[String][String]`>().`[recursively][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.recursively]`() }`
40234020
*
4024-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColumnGroup.`[all][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.all]`().`[rec][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.rec]`(includeGroups = false) }`
4021+
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColumnGroup.`[all][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.all]`().`[rec][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.rec]`() }`
40254022
*
40264023
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[groups][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.groups]`().`[recursively][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.recursively]`(includeTopLevel = false) }`
40274024
*
4028-
* @param [includeGroups] Whether to include [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] in the result. `true` by default.
40294025
* @param [includeTopLevel] Whether to include the top-level columns in the result. `true` by default.
40304026
*/
40314027
public fun <C> TransformableColumnSet<C>.rec(
4032-
includeGroups: Boolean = true,
40334028
includeTopLevel: Boolean = true,
4034-
): ColumnSet<C> = recursively(includeTopLevel = includeTopLevel, includeGroups = includeGroups)
4029+
): ColumnSet<C> = recursively(includeTopLevel = includeTopLevel)
40354030

40364031
/**
40374032
* ## Recursively / Rec
@@ -4058,15 +4053,13 @@ public interface ColumnsSelectionDsl<out T> : ColumnSelectionDsl<T>, SingleColum
40584053
*
40594054
* `df.`[select][DataFrame.select]` { `[first][ColumnSet.first]` { col -> col.`[any][DataColumn.any]` { it == "Alice" } }.`[recursively][recursively]`(includeTopLevel = false) }`
40604055
*
4061-
* `df.`[select][DataFrame.select]` { `[single][ColumnSet.single]` { it.name == "myCol" }.`[rec][rec]`(includeGroups = false) }`
4056+
* `df.`[select][DataFrame.select]` { `[single][ColumnSet.single]` { it.name == "myCol" }.`[rec][rec]`() }`
40624057
*
4063-
* @param [includeGroups] Whether to include [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] in the result. `true` by default.
40644058
* @param [includeTopLevel] Whether to include the top-level columns in the result. `true` by default.
40654059
*/
40664060
public fun TransformableSingleColumn<*>.recursively(
4067-
includeGroups: Boolean = true,
40684061
includeTopLevel: Boolean = true,
4069-
): SingleColumn<*> = recursivelyImpl(includeTopLevel = includeTopLevel, includeGroups = includeGroups)
4062+
): SingleColumn<*> = recursivelyImpl(includeTopLevel = includeTopLevel, includeGroups = true)
40704063

40714064
/** ## Recursively / Rec
40724065
*
@@ -4092,15 +4085,13 @@ public interface ColumnsSelectionDsl<out T> : ColumnSelectionDsl<T>, SingleColum
40924085
*
40934086
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[first][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.first]` { col -> col.`[any][org.jetbrains.kotlinx.dataframe.DataColumn.any]` { it == "Alice" } }.`[recursively][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.recursively]`(includeTopLevel = false) }`
40944087
*
4095-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[single][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.single]` { it.name == "myCol" }.`[rec][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.rec]`(includeGroups = false) }`
4088+
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[single][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.single]` { it.name == "myCol" }.`[rec][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.rec]`() }`
40964089
*
4097-
* @param [includeGroups] Whether to include [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] in the result. `true` by default.
40984090
* @param [includeTopLevel] Whether to include the top-level columns in the result. `true` by default.
40994091
*/
41004092
public fun TransformableSingleColumn<*>.rec(
4101-
includeGroups: Boolean = true,
41024093
includeTopLevel: Boolean = true,
4103-
): SingleColumn<*> = recursively(includeTopLevel = includeTopLevel, includeGroups = includeGroups)
4094+
): SingleColumn<*> = recursively(includeTopLevel = includeTopLevel)
41044095

41054096
/**
41064097
* ## All Recursively / All Rec

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public fun <T> DataFrame<T>.cumSum(vararg columns: KProperty<*>, skipNA: Boolean
5353
cumSum(skipNA) { columns.toColumnSet() }
5454

5555
public fun <T> DataFrame<T>.cumSum(skipNA: Boolean = defaultCumSumSkipNA): DataFrame<T> = cumSum(skipNA) {
56-
all().recursively(includeGroups = false)
56+
allRecursively(includeGroups = false)
5757
}
5858

5959
// endregion
@@ -80,6 +80,6 @@ public fun <T, G> GroupBy<T, G>.cumSum(
8080
): GroupBy<T, G> = cumSum(skipNA) { columns.toColumnSet() }
8181

8282
public fun <T, G> GroupBy<T, G>.cumSum(skipNA: Boolean = defaultCumSumSkipNA): GroupBy<T, G> =
83-
cumSum(skipNA) { all().recursively(includeGroups = false) }
83+
cumSum(skipNA) { allRecursively(includeGroups = false) }
8484

8585
// endregion

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public fun <T> DataColumn<T>.describe(): DataFrame<ColumnDescription> = describe
3939

4040
// region DataFrame
4141

42-
public fun <T> DataFrame<T>.describe(): DataFrame<ColumnDescription> = describe { all().recursively(includeGroups = false) }
42+
public fun <T> DataFrame<T>.describe(): DataFrame<ColumnDescription> = describe { allRecursively(includeGroups = false) }
4343

4444
public fun <T> DataFrame<T>.describe(columns: ColumnsSelector<T, *>): DataFrame<ColumnDescription> =
4545
describeImpl(getColumnsWithPaths(columns))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public fun AnyCol.inferType(): DataColumn<*> = guessColumnType(name, toList(), t
1414

1515
// region DataFrame
1616

17-
public fun <T> DataFrame<T>.inferType(): DataFrame<T> = inferType { all().recursively(includeGroups = false) }
17+
public fun <T> DataFrame<T>.inferType(): DataFrame<T> = inferType { allRecursively(includeGroups = false) }
1818

1919
public fun <T> DataFrame<T>.inferType(columns: ColumnsSelector<T, *>): DataFrame<T> =
2020
replace(columns).with { it.inferType() }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public data class ParserOptions(
5656
public fun DataColumn<String?>.tryParse(options: ParserOptions? = null): DataColumn<*> = tryParseImpl(options)
5757

5858
public fun <T> DataFrame<T>.parse(options: ParserOptions? = null): DataFrame<T> = parse(options) {
59-
all().recursively(includeGroups = false)
59+
allRecursively(includeGroups = false)
6060
}
6161

6262
public fun DataColumn<String?>.parse(options: ParserOptions? = null): DataColumn<*> =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public fun <T> DataFrame<T>.renameToCamelCase(): DataFrame<T> = this
4949
}.toCamelCase()
5050

5151
.rename {
52-
cols { it.name() matches DELIMITED_STRING_REGEX }.recursively(includeGroups = false)
52+
cols { !it.isColumnGroup() && it.name() matches DELIMITED_STRING_REGEX }.recursively()
5353
}.toCamelCase()
5454

5555
.update {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public fun <T, V : Comparable<V>> DataFrame<T>.reorderColumnsBy(
4545
): DataFrame<T> =
4646
Reorder(
4747
df = this,
48-
columns = { if (recursively) all().recursively() else all() },
48+
columns = { if (recursively) allRecursively() else all() },
4949
inFrameColumns = recursively,
5050
).reorderImpl(desc, expression)
5151

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.jetbrains.kotlinx.dataframe.impl.api.xsImpl
77
// region DataFrame
88

99
public fun <T> DataFrame<T>.xs(vararg keyValues: Any?): DataFrame<T> = xs(*keyValues) {
10-
all().recursively(includeGroups = false).take(keyValues.size)
10+
allRecursively(includeGroups = false).take(keyValues.size)
1111
}
1212

1313
public fun <T, C> DataFrame<T>.xs(vararg keyValues: C, keyColumns: ColumnsSelector<T, C>): DataFrame<T> =
@@ -18,7 +18,7 @@ public fun <T, C> DataFrame<T>.xs(vararg keyValues: C, keyColumns: ColumnsSelect
1818
// region GroupBy
1919

2020
public fun <T, G> GroupBy<T, G>.xs(vararg keyValues: Any?): GroupBy<T, G> = xs(*keyValues) {
21-
all().recursively(includeGroups = false).take(keyValues.size)
21+
allRecursively(includeGroups = false).take(keyValues.size)
2222
}
2323

2424
public fun <T, G, C> GroupBy<T, G>.xs(vararg keyValues: C, keyColumns: ColumnsSelector<T, C>): GroupBy<T, G> =

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/GroupByImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ internal fun <T, G, R> aggregateGroupBy(
9595

9696
if (!removeColumns) removedNode.data.wasRemoved = false
9797

98-
val columnsToInsert = groupedFrame.getColumnsWithPaths { all().recursively(includeGroups = false) }.map {
98+
val columnsToInsert = groupedFrame.getColumnsWithPaths { allRecursively(includeGroups = false) }.map {
9999
ColumnToInsert(insertPath + it.path, it, removedNode)
100100
}
101101
val src = if (removeColumns) removed.df else df

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal fun <T, C> DataFrame<T>.flattenImpl(
2727
fun getRootPrefix(path: ColumnPath) =
2828
(1 until path.size).asSequence().map { path.take(it) }.first { rootPrefixes.contains(it) }
2929

30-
val result = move { rootPrefixes.toColumnSet().all().recursively(includeGroups = false, includeTopLevel = false) }
30+
val result = move { rootPrefixes.toColumnSet().allRecursively(includeGroups = false, includeTopLevel = false) }
3131
.into {
3232
val targetPath = getRootPrefix(it.path).dropLast(1)
3333
val nameGen = nameGenerators[targetPath]!!

0 commit comments

Comments
 (0)