Skip to content

Commit cc4d858

Browse files
committed
Merge branch 'master' into column-selector-docs3
2 parents 621f1e4 + a8dad48 commit cc4d858

File tree

49 files changed

+555
-1033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+555
-1033
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Default ignored files
22
.idea
33
.gradle
4+
.kotlin
45
build
56
.ipynb_checkpoints

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ public interface ColumnsForAggregateSelectionDsl<out T> : ColumnsSelectionDsl<T>
1313
ConfiguredAggregateColumn.withDefault(this, defaultValue)
1414

1515
public infix fun <C> SingleColumn<C>.default(defaultValue: C): SingleColumn<C> =
16-
ConfiguredAggregateColumn.withDefault(this, defaultValue).single()
16+
ConfiguredAggregateColumn.withDefault(this, defaultValue)
1717

1818
public fun path(vararg names: String): ColumnPath = ColumnPath(names.asList())
1919

20-
public infix fun <C> ColumnSet<C>.into(name: String): ColumnSet<C> = ConfiguredAggregateColumn.withPath(this, pathOf(name))
20+
public infix fun <C> ColumnSet<C>.into(name: String): ColumnSet<C> =
21+
ConfiguredAggregateColumn.withPath(this, pathOf(name))
2122

2223
public infix fun <C> SingleColumn<C>.into(name: String): SingleColumn<C> =
23-
ConfiguredAggregateColumn.withPath(this, pathOf(name)).single()
24+
ConfiguredAggregateColumn.withPath(this, pathOf(name))
2425

25-
public infix fun <C> ColumnSet<C>.into(path: ColumnPath): ColumnSet<C> = ConfiguredAggregateColumn.withPath(this, path)
26+
public infix fun <C> ColumnSet<C>.into(path: ColumnPath): ColumnSet<C> =
27+
ConfiguredAggregateColumn.withPath(this, path)
2628

2729
public infix fun <C> SingleColumn<C>.into(path: ColumnPath): SingleColumn<C> =
28-
ConfiguredAggregateColumn.withPath(this, path).single()
30+
ConfiguredAggregateColumn.withPath(this, path)
2931
}

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

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ public interface ColumnsSelectionDsl<out T> : /* SingleColumn<DataRow<T>> */
8484
SingleColumnsSelectionDsl,
8585

8686
// col(name), col(5), [5]
87-
ColColumnsSelectionDsl,
87+
ColColumnsSelectionDsl<T>,
8888
// valueCol(name), valueCol(5)
89-
ValueColColumnsSelectionDsl,
89+
ValueColColumnsSelectionDsl<T>,
9090
// frameCol(name), frameCol(5)
91-
FrameColColumnsSelectionDsl,
91+
FrameColColumnsSelectionDsl<T>,
9292
// colGroup(name), colGroup(5)
93-
ColGroupColumnsSelectionDsl,
93+
ColGroupColumnsSelectionDsl<T>,
9494

9595
// cols {}, cols(), cols(colA, colB), cols(1, 5), cols(1..5), [{}]
96-
ColsColumnsSelectionDsl,
96+
ColsColumnsSelectionDsl<T>,
9797

9898
// colA.."colB"
9999
ColumnRangeColumnsSelectionDsl,
@@ -108,7 +108,7 @@ public interface ColumnsSelectionDsl<out T> : /* SingleColumn<DataRow<T>> */
108108
ColsOfKindColumnsSelectionDsl,
109109

110110
// all(Cols), allAfter(colA), allBefore(colA), allFrom(colA), allUpTo(colA)
111-
AllColumnsSelectionDsl,
111+
AllColumnsSelectionDsl<T>,
112112
// colsAtAnyDepth {}, colsAtAnyDepth()
113113
ColsAtAnyDepthColumnsSelectionDsl,
114114
// colsInGroups {}, colsInGroups()
@@ -489,58 +489,6 @@ public interface ColumnsSelectionDsl<out T> : /* SingleColumn<DataRow<T>> */
489489
public operator fun <C, R> SingleColumn<DataRow<C>>.invoke(selector: ColumnsSelector<C, R>): ColumnSet<R> =
490490
select(selector)
491491

492-
/**
493-
* ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]
494-
*
495-
* Perform a selection of columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] on
496-
* any [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]. This is more powerful than the [cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols] filter, because now all
497-
* operations of the DSL are at your disposal.
498-
*
499-
* The scope of the new DSL instance is relative to
500-
* the [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] you are selecting from.
501-
*
502-
* The [invoke][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.invoke] operator is overloaded to work as a shortcut for this method.
503-
*
504-
* ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.Grammar]
505-
*
506-
* #### For example:
507-
*
508-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColGroup.`[select][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.select]` { someCol `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` `[colsOf][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.colsOf]`<`[String][String]`>() } }`
509-
*
510-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "myGroupCol" `[{][kotlin.String.select]` "colA" and `[expr][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.expr]` { 0 } `[}][kotlin.String.select]` }`
511-
*
512-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["myGroupCol"].`[select][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.select]` { "colA" and "colB" } }`
513-
*
514-
* `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { it["myGroupCol"].`[asColumnGroup][org.jetbrains.kotlinx.dataframe.DataColumn.asColumnGroup]`()`[() {][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.select]` "colA" and "colB" `[}][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.select]` }`
515-
*
516-
* #### Examples for this overload:
517-
*
518-
* `df.`[select][DataFrame.select]` { Type::myColGroup.`[`select`][KProperty.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }`
519-
*
520-
* `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[`and`][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }`
521-
*
522-
* ## NOTE:
523-
* If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you
524-
* can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler
525-
* ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)).
526-
*
527-
*
528-
* &nbsp;&nbsp;&nbsp;&nbsp;
529-
*
530-
*
531-
* See also [except][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.except]/[allExcept][org.jetbrains.kotlinx.dataframe.api.AllExceptColumnsSelectionDsl.allColsExcept] for the inverted operation of this function.
532-
*
533-
* @param [selector] The [ColumnsSelector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] to use for the selection.
534-
* @receiver The [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] to select from.
535-
* @throws [IllegalArgumentException] If [this] is not a [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup].
536-
* @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector].
537-
* @see [SingleColumn.except]
538-
*/
539-
@Suppress("INAPPLICABLE_JVM_NAME")
540-
@JvmName("KPropertyDataRowInvoke")
541-
public operator fun <C, R> KProperty<DataRow<C>>.invoke(selector: ColumnsSelector<C, R>): ColumnSet<R> =
542-
select(selector)
543-
544492
/**
545493
* ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]
546494
*
@@ -583,8 +531,6 @@ public interface ColumnsSelectionDsl<out T> : /* SingleColumn<DataRow<T>> */
583531
* @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector].
584532
* @see [SingleColumn.except]
585533
*/
586-
@OptIn(ExperimentalTypeInference::class)
587-
@OverloadResolutionByLambdaReturnType
588534
public operator fun <C, R> KProperty<C>.invoke(selector: ColumnsSelector<C, R>): ColumnSet<R> =
589535
columnGroup(this).select(selector)
590536

0 commit comments

Comments
 (0)