Skip to content

Commit 06f123b

Browse files
committed
Fixes #1548 by making all pivot shortcuts use PivotDsl
1 parent ef50adf commit 06f123b

File tree

1 file changed

+14
-14
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+14
-14
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/pivot.kt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,11 @@ internal interface DataFramePivotMatchesCommonDocs
498498
*
499499
* @param [inward] If `true` (default), the generated pivoted columns are nested inside the original column;
500500
* if `false`, they are placed at the top level.
501-
* @param [columns] The [Columns Selector][ColumnsSelector] that defines which columns are used as [pivot] keys for the operation.
501+
* @param [columns] The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used as [pivot] keys for the operation.
502502
* @return A new [DataFrame] representing a [Boolean] presence matrix — with grouping key columns as rows,
503503
* pivot key values as columns, and `true`/`false` cells indicating existing combinations.
504504
*/
505-
public fun <T> DataFrame<T>.pivotMatches(inward: Boolean = true, columns: ColumnsSelector<T, *>): DataFrame<T> =
505+
public fun <T> DataFrame<T>.pivotMatches(inward: Boolean = true, columns: PivotColumnsSelector<T, *>): DataFrame<T> =
506506
pivot(inward, columns).groupByOther().matches()
507507

508508
/**
@@ -588,11 +588,11 @@ internal interface DataFramePivotCountsCommonDocs
588588
* ```
589589
*
590590
* @include [PivotDocs.InwardKDocs]
591-
* @param [columns] The [Columns Selector][ColumnsSelector] that defines which columns are used as [pivot] keys for the operation.
591+
* @param [columns] The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used as [pivot] keys for the operation.
592592
* @return A new [DataFrame] representing a counting matrix — with grouping key columns as rows,
593593
* pivot key values as columns, and the number of rows with the corresponding combinations in the cells.
594594
*/
595-
public fun <T> DataFrame<T>.pivotCounts(inward: Boolean = true, columns: ColumnsSelector<T, *>): DataFrame<T> =
595+
public fun <T> DataFrame<T>.pivotCounts(inward: Boolean = true, columns: PivotColumnsSelector<T, *>): DataFrame<T> =
596596
pivot(inward, columns).groupByOther().count()
597597

598598
/**
@@ -655,11 +655,11 @@ private interface CommonPivotForGroupByDocs
655655
* @include [CommonPivotForGroupByDocs]
656656
* @include [SelectingColumns.Dsl.WithExample] {@include [SetPivotOperationArg] {@set [SelectingColumns.RECEIVER] <code>`gb`</code>}}
657657
* @include [PivotDocs.InwardKDocsForGrouped]
658-
* @param [columns] The [Columns Selector][ColumnsSelector] that defines which columns are pivoted.
658+
* @param [columns] The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are pivoted.
659659
* @return A new [PivotGroupBy] that preserves the original [groupBy] key columns
660660
* and pivots the provided columns.
661661
*/
662-
public fun <G> GroupBy<*, G>.pivot(inward: Boolean = true, columns: ColumnsSelector<G, *>): PivotGroupBy<G> =
662+
public fun <G> GroupBy<*, G>.pivot(inward: Boolean = true, columns: PivotColumnsSelector<G, *>): PivotGroupBy<G> =
663663
PivotGroupByImpl(this, columns, inward)
664664

665665
@Deprecated(DEPRECATED_ACCESS_API)
@@ -723,11 +723,11 @@ internal interface GroupByPivotMatchesCommonDocs
723723
* ```
724724
*
725725
* @include [PivotDocs.InwardKDocsForGrouped]
726-
* @param [columns] The [Columns Selector][ColumnsSelector] that defines which columns are used as [pivot] keys for the operation.
726+
* @param [columns] The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used as [pivot] keys for the operation.
727727
* @return A new [DataFrame] representing a Boolean presence matrix — with grouping key columns as rows,
728728
* pivot key values as columns, and `true`/`false` cells indicating existing combinations.
729729
*/
730-
public fun <G> GroupBy<*, G>.pivotMatches(inward: Boolean = true, columns: ColumnsSelector<G, *>): DataFrame<G> =
730+
public fun <G> GroupBy<*, G>.pivotMatches(inward: Boolean = true, columns: PivotColumnsSelector<G, *>): DataFrame<G> =
731731
pivot(inward, columns).matches()
732732

733733
/**
@@ -797,11 +797,11 @@ internal interface GroupByPivotCountsCommonDocs
797797
* ```
798798
*
799799
* @include [PivotDocs.InwardKDocsForGrouped]
800-
* @param [columns] The [Columns Selector][ColumnsSelector] that defines which columns are used as [pivot] keys for the operation.
800+
* @param [columns] The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used as [pivot] keys for the operation.
801801
* @return A new [DataFrame] representing a counting matrix — with grouping key columns as rows,
802802
* pivot key values as columns, and the number of rows with the corresponding combinations in the cells.
803803
*/
804-
public fun <G> GroupBy<*, G>.pivotCounts(inward: Boolean = true, columns: ColumnsSelector<G, *>): DataFrame<G> =
804+
public fun <G> GroupBy<*, G>.pivotCounts(inward: Boolean = true, columns: PivotColumnsSelector<G, *>): DataFrame<G> =
805805
pivot(inward, columns).count()
806806

807807
/**
@@ -994,15 +994,15 @@ internal interface AggregateGroupedDslPivotMatchesDocs
994994
* ```
995995
*
996996
* @include [PivotDocs.InwardKDocsForGrouped]
997-
* @param columns The [Columns Selector][ColumnsSelector] that defines which columns are used
997+
* @param columns The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used
998998
* as keys for pivoting and in which order.
999999
* @return A new [DataFrame] representing a Boolean presence matrix — with grouping key columns as rows,
10001000
* pivot key values as columns, and `true`/`false` cells indicating existing combinations.
10011001
* This [DataFrame] is added to the [aggregate][Grouped.aggregate] result.
10021002
*/
10031003
public fun <T> AggregateGroupedDsl<T>.pivotMatches(
10041004
inward: Boolean = true,
1005-
columns: ColumnsSelector<T, *>,
1005+
columns: PivotColumnsSelector<T, *>,
10061006
): DataFrame<T> = pivot(inward, columns).matches()
10071007

10081008
/**
@@ -1079,15 +1079,15 @@ internal interface AggregateGroupedDslPivotCountsDocs
10791079
* ```
10801080
*
10811081
* @include [PivotDocs.InwardKDocsForGrouped]
1082-
* @param columns The [Columns Selector][ColumnsSelector] that defines which columns are used
1082+
* @param columns The [Pivot Columns Selector][PivotColumnsSelector]that defines which columns are used
10831083
* as keys for pivoting and in which order.
10841084
* @return A new [DataFrame] representing a counting matrix — with grouping key columns as rows,
10851085
* pivot key values as columns, and the number of rows with the corresponding combinations in the cells.
10861086
* This [DataFrame] is added to the [aggregate][Grouped.aggregate] result.
10871087
*/
10881088
public fun <T> AggregateGroupedDsl<T>.pivotCounts(
10891089
inward: Boolean = true,
1090-
columns: ColumnsSelector<T, *>,
1090+
columns: PivotColumnsSelector<T, *>,
10911091
): DataFrame<T> = pivot(inward, columns).count()
10921092

10931093
/**

0 commit comments

Comments
 (0)