diff --git a/.gitignore b/.gitignore index 43306037d2..13c5a84b89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Default ignored files .idea .gradle +.kotlin build .ipynb_checkpoints diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt index 5ead992aab..f3d91b35f0 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt @@ -13,17 +13,19 @@ public interface ColumnsForAggregateSelectionDsl : ColumnsSelectionDsl ConfiguredAggregateColumn.withDefault(this, defaultValue) public infix fun SingleColumn.default(defaultValue: C): SingleColumn = - ConfiguredAggregateColumn.withDefault(this, defaultValue).single() + ConfiguredAggregateColumn.withDefault(this, defaultValue) public fun path(vararg names: String): ColumnPath = ColumnPath(names.asList()) - public infix fun ColumnSet.into(name: String): ColumnSet = ConfiguredAggregateColumn.withPath(this, pathOf(name)) + public infix fun ColumnSet.into(name: String): ColumnSet = + ConfiguredAggregateColumn.withPath(this, pathOf(name)) public infix fun SingleColumn.into(name: String): SingleColumn = - ConfiguredAggregateColumn.withPath(this, pathOf(name)).single() + ConfiguredAggregateColumn.withPath(this, pathOf(name)) - public infix fun ColumnSet.into(path: ColumnPath): ColumnSet = ConfiguredAggregateColumn.withPath(this, path) + public infix fun ColumnSet.into(path: ColumnPath): ColumnSet = + ConfiguredAggregateColumn.withPath(this, path) public infix fun SingleColumn.into(path: ColumnPath): SingleColumn = - ConfiguredAggregateColumn.withPath(this, path).single() + ConfiguredAggregateColumn.withPath(this, path) } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt index cdb4a2cefa..596790ba1e 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt @@ -82,16 +82,16 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ SingleColumnsSelectionDsl, // col(name), col(5), [5] - ColColumnsSelectionDsl, + ColColumnsSelectionDsl, // valueCol(name), valueCol(5) - ValueColColumnsSelectionDsl, + ValueColColumnsSelectionDsl, // frameCol(name), frameCol(5) - FrameColColumnsSelectionDsl, + FrameColColumnsSelectionDsl, // colGroup(name), colGroup(5) - ColGroupColumnsSelectionDsl, + ColGroupColumnsSelectionDsl, // cols {}, cols(), cols(colA, colB), cols(1, 5), cols(1..5), [{}] - ColsColumnsSelectionDsl, + ColsColumnsSelectionDsl, // colA.."colB" ColumnRangeColumnsSelectionDsl, @@ -106,7 +106,7 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ ColsOfKindColumnsSelectionDsl, // all(Cols), allAfter(colA), allBefore(colA), allFrom(colA), allUpTo(colA) - AllColumnsSelectionDsl, + AllColumnsSelectionDsl, // colsAtAnyDepth {}, colsAtAnyDepth() ColsAtAnyDepthColumnsSelectionDsl, // colsInGroups {}, colsInGroups() @@ -494,58 +494,6 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ public operator fun SingleColumn>.invoke(selector: ColumnsSelector): ColumnSet = select(selector) - /** - * ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] - * - * Perform a selection of columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] on - * 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 - * operations of the DSL are at your disposal. - * - * The scope of the new DSL instance is relative to - * the [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] you are selecting from. - * - * The [invoke][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.invoke] operator is overloaded to work as a shortcut for this method. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `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]`>() } }` - * - * `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]` }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["myGroupCol"].`[select][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.select]` { "colA" and "colB" } }` - * - * `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]` }` - * - * #### Examples for this overload: - * - * `df.`[select][DataFrame.select]` { Type::myColGroup.`[`select`][KProperty.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }` - * - * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[`and`][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * - *      - * - * - * 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. - * - * @param [selector] The [ColumnsSelector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] to use for the selection. - * @receiver The [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] to select from. - * @throws [IllegalArgumentException] If [this] is not a [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector]. - * @see [SingleColumn.except] - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowInvoke") - public operator fun KProperty>.invoke(selector: ColumnsSelector): ColumnSet = - select(selector) - /** * ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] * @@ -588,8 +536,6 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector]. * @see [SingleColumn.except] */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType public operator fun KProperty.invoke(selector: ColumnsSelector): ColumnSet = columnGroup(this).select(selector) diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt index 977ccfb738..cc6cb89a2f 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubse import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionArg import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionColsArg import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.TitleArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.After import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.Before import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.ColumnGroupName @@ -36,6 +37,7 @@ import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.addPath @@ -88,8 +90,9 @@ public fun DataFrame.all(predicate: RowFilter): Boolean = rows().all { * ## All Flavors of All (Cols) [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface AllColumnsSelectionDsl { +public interface AllColumnsSelectionDsl { /** * ## Grammar of All Flavors of All (Cols): @@ -1835,12 +1838,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -1870,80 +1868,9 @@ public interface AllColumnsSelectionDsl { * @param [column] The specified column after which all columns should be taken. This column can be referenced * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsAfter(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsAfter(column) - /** - * ## All (Cols) After - * - * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], - * containing all columns after [column], excluding [column] itself. - * - * [column] can be specified both relative to the current [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] or the outer scope and - * can be referenced using any [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]. - * - * If [column] does not exist, the function will return an empty [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - *      - * - * NOTE: Using the `{}` overloads of these functions requires a [ColumnSelector][org.jetbrains.kotlinx.dataframe.ColumnSelector] to be used - * in the Plain DSL, and on [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] and a [ColumnFilter][org.jetbrains.kotlinx.dataframe.ColumnFilter] on [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allAfter][ColumnsSelectionDsl.allAfter]`("someColumn") }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colGroup][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroup]`(Type::myColGroup).`[allColsAfter][SingleColumn.allColsAfter]`(someColumn) }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().`[allAfter][ColumnSet.allAfter]`(Type::someColumn) }` - * - * #### Examples for this overload: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * #### Flavors of All (Cols): - * - * - [`all(Cols)`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols]`()`: - * All columns - * - * - [`all(Cols)Before`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsBefore]`(column)`: - * All columns before the specified column, excluding that column - * - * - [`all(Cols)After`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsAfter]`(column)`: - * All columns after the specified column, excluding that column - * - * - [`all(Cols)From`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsFrom]`(column)`: - * All columns from the specified column, including that column - * - * - [`all(Cols)UpTo`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(column)`: - * All columns up to the specified column, including that column - * - * @return A new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns after [column], excluding [column] itself. - * @see [allBefore] - * @see [allAfter] - * @see [allFrom] - * @see [allUpTo] - * @see [ColumnsSelectionDsl.allExcept] - * @see [all] - * @see [cols] - * @param [column] The specified column after which all columns should be taken. This column can be referenced - * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsAfter") - public fun KProperty>.allColsAfter(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsAfter(column) - /** ## All (Cols) After * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -1971,12 +1898,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("pathTo"["myColumn"]) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -2036,12 +1958,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("myColumn") }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -2101,12 +2018,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -2166,12 +2078,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(Type::myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][kotlin.reflect.KProperty.allColsAfter]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -3823,12 +3730,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -3858,80 +3760,9 @@ public interface AllColumnsSelectionDsl { * @param [column] The specified column from which all columns should be taken. This column can be referenced * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsFrom(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsFrom(column) - /** - * ## All (Cols) From - * - * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], - * containing all columns from [column], including [column] itself. - * - * [column] can be specified both relative to the current [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] or the outer scope and - * can be referenced using any [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]. - * - * If [column] does not exist, the function will return an empty [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - *      - * - * NOTE: Using the `{}` overloads of these functions requires a [ColumnSelector][org.jetbrains.kotlinx.dataframe.ColumnSelector] to be used - * in the Plain DSL, and on [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] and a [ColumnFilter][org.jetbrains.kotlinx.dataframe.ColumnFilter] on [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allFrom][ColumnsSelectionDsl.allFrom]`("someColumn") }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colGroup][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroup]`(Type::myColGroup).`[allColsFrom][SingleColumn.allColsFrom]`(someColumn) }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().`[allFrom][ColumnSet.allFrom]`(Type::someColumn) }` - * - * #### Examples for this overload: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * #### Flavors of All (Cols): - * - * - [`all(Cols)`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols]`()`: - * All columns - * - * - [`all(Cols)Before`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsBefore]`(column)`: - * All columns before the specified column, excluding that column - * - * - [`all(Cols)After`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsAfter]`(column)`: - * All columns after the specified column, excluding that column - * - * - [`all(Cols)From`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsFrom]`(column)`: - * All columns from the specified column, including that column - * - * - [`all(Cols)UpTo`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(column)`: - * All columns up to the specified column, including that column - * - * @return A new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns from [column], including [column] itself. - * @see [allBefore] - * @see [allAfter] - * @see [allFrom] - * @see [allUpTo] - * @see [ColumnsSelectionDsl.allExcept] - * @see [all] - * @see [cols] - * @param [column] The specified column from which all columns should be taken. This column can be referenced - * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsFrom") - public fun KProperty>.allColsFrom(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsFrom(column) - /** ## All (Cols) From * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -3959,12 +3790,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("pathTo"["myColumn"]) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -4024,12 +3850,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("myColumn") }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -4089,12 +3910,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -4154,12 +3970,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(Type::myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][kotlin.reflect.KProperty.allColsFrom]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -5808,12 +5619,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -5843,80 +5649,9 @@ public interface AllColumnsSelectionDsl { * @param [column] The specified column before which all columns should be taken. This column can be referenced * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsBefore(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsBefore(column) - /** - * ## All (Cols) Before - * - * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], - * containing all columns before [column], excluding [column] itself. - * - * [column] can be specified both relative to the current [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] or the outer scope and - * can be referenced using any [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]. - * - * If [column] does not exist, the function will return a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns. - * - *      - * - * NOTE: Using the `{}` overloads of these functions requires a [ColumnSelector][org.jetbrains.kotlinx.dataframe.ColumnSelector] to be used - * in the Plain DSL, and on [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] and a [ColumnFilter][org.jetbrains.kotlinx.dataframe.ColumnFilter] on [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allBefore][ColumnsSelectionDsl.allBefore]`("someColumn") }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colGroup][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroup]`(Type::myColGroup).`[allColsBefore][SingleColumn.allColsBefore]`(someColumn) }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().`[allBefore][ColumnSet.allBefore]`(Type::someColumn) }` - * - * #### Examples for this overload: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * #### Flavors of All (Cols): - * - * - [`all(Cols)`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols]`()`: - * All columns - * - * - [`all(Cols)Before`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsBefore]`(column)`: - * All columns before the specified column, excluding that column - * - * - [`all(Cols)After`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsAfter]`(column)`: - * All columns after the specified column, excluding that column - * - * - [`all(Cols)From`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsFrom]`(column)`: - * All columns from the specified column, including that column - * - * - [`all(Cols)UpTo`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(column)`: - * All columns up to the specified column, including that column - * - * @return A new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns before [column], excluding [column] itself. - * @see [allBefore] - * @see [allAfter] - * @see [allFrom] - * @see [allUpTo] - * @see [ColumnsSelectionDsl.allExcept] - * @see [all] - * @see [cols] - * @param [column] The specified column before which all columns should be taken. This column can be referenced - * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsBefore") - public fun KProperty>.allColsBefore(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsBefore(column) - /** ## All (Cols) Before * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -5944,12 +5679,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("pathTo"["myColumn"]) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -6009,12 +5739,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("myColumn") }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -6074,12 +5799,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -6139,12 +5859,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(Type::myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][kotlin.reflect.KProperty.allColsBefore]`(Type::myColumn) }` * * #### Flavors of All (Cols): * @@ -7796,12 +7511,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]` { myColumn } }` * * #### Flavors of All (Cols): * @@ -7831,80 +7541,9 @@ public interface AllColumnsSelectionDsl { * @param [column] The specified column up to which all columns should be taken. This column can be referenced * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsUpTo(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsUpTo(column) - /** - * ## All (Cols) Up To - * - * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], - * containing all columns up to [column], including [column] itself. - * - * [column] can be specified both relative to the current [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] or the outer scope and - * can be referenced using any [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi]. - * - * If [column] does not exist, the function will return a [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns. - * - *      - * - * NOTE: Using the `{}` overloads of these functions requires a [ColumnSelector][org.jetbrains.kotlinx.dataframe.ColumnSelector] to be used - * in the Plain DSL, and on [column groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] and a [ColumnFilter][org.jetbrains.kotlinx.dataframe.ColumnFilter] on [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allUpTo][ColumnsSelectionDsl.allUpTo]`("someColumn") }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colGroup][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colGroup]`(Type::myColGroup).`[allColsUpTo][SingleColumn.allColsUpTo]`(someColumn) }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsOf]`<`[Int][Int]`>().`[allUpTo][ColumnSet.allUpTo]`(Type::someColumn) }` - * - * #### Examples for this overload: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]` { myColumn } }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * #### Flavors of All (Cols): - * - * - [`all(Cols)`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols]`()`: - * All columns - * - * - [`all(Cols)Before`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsBefore]`(column)`: - * All columns before the specified column, excluding that column - * - * - [`all(Cols)After`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsAfter]`(column)`: - * All columns after the specified column, excluding that column - * - * - [`all(Cols)From`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsFrom]`(column)`: - * All columns from the specified column, including that column - * - * - [`all(Cols)UpTo`][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allColsUpTo]`(column)`: - * All columns up to the specified column, including that column - * - * @return A new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns up to [column], including [column] itself. - * @see [allBefore] - * @see [allAfter] - * @see [allFrom] - * @see [allUpTo] - * @see [ColumnsSelectionDsl.allExcept] - * @see [all] - * @see [cols] - * @param [column] The specified column up to which all columns should be taken. This column can be referenced - * to both relatively to the current [ColumnsResolver][org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver] and absolutely. - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsUpTo") - public fun KProperty>.allColsUpTo(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsUpTo(column) - /** ## All (Cols) Up To * * Creates a new [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] that contains a subset of columns from [this], @@ -7932,12 +7571,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("pathTo"["myColumn"]) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("pathTo"["myColumn"]) }` * * #### Flavors of All (Cols): * @@ -7997,12 +7631,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("myColumn") }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`("myColumn") }` * * #### Flavors of All (Cols): * @@ -8062,12 +7691,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(myColumn) }` * * #### Flavors of All (Cols): * @@ -8127,12 +7751,7 @@ public interface AllColumnsSelectionDsl { * * #### Examples for this overload: * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(Type::myColumn) }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). + * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][kotlin.reflect.KProperty.allColsUpTo]`(Type::myColumn) }` * * #### Flavors of All (Cols): * diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index 0fae38844a..75ff30fc6c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -2858,10 +2858,6 @@ public interface AllExceptColumnsSelectionDsl { * `df.`[select][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.select]` { ``DataSchemaPerson::userData.`[allColsExcept][KProperty.allColsExcept]` { "age" `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` height }`` }` * * `df.`[select][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.select]` { city `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` ``Person::name.`[allColsExcept][KProperty.allColsExcept]` { firstName }`` }` - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). * * @param [selector] A lambda in which you specify the columns that need to be * excluded from the current selection in [this] column group. The other columns will be included in the selection @@ -2874,112 +2870,9 @@ public interface AllExceptColumnsSelectionDsl { * @see ColumnsSelectionDsl.allUpTo * @see ColumnsSelectionDsl.allFrom */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsExcept(selector: ColumnsSelector): ColumnSet<*> = columnGroup(this).allColsExcept(selector) - /** - * ## (All) (Cols) Except - * - * Perform a selection of columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] to - * exclude from the current selection. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.AllExceptColumnsSelectionDsl.Grammar] - * - * ### On [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] - * This function can be explained the easiest with [ColumnSets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet]. Let's say we want all - * [Int] columns apart from `age` and `height`. - * - * We can do: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsOf][org.jetbrains.kotlinx.dataframe.api.colsOf]`<`[Int][Int]`>() `[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]` (age `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` height) }` - * - * which will 'subtract' the [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] created by `age `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` height` from the [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] created by [colsOf][org.jetbrains.kotlinx.dataframe.api.colsOf]`<`[Int][Int]`>()`. - * - * - *      - * - * This operation can also be used to exclude columns from [Column Groups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]. - * - * For instance: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[colsAtAnyDepth][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.colsAtAnyDepth]` { "a" `[in][String.contains]` it.`[name][org.jetbrains.kotlinx.dataframe.DataColumn.name]`() } `[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]` userData.age }` - * - *      - * - * - * Note that the selection of columns to exclude from [column sets][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] is always done relative to the outer - * scope. Use the [Extension Properties API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi.ExtensionPropertiesApi] to prevent scoping issues if possible. - * - *      - * - * Special case: If a column that needs to be removed appears multiple times in the [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet], it is excepted - * each time it is encountered (including inside [ColumnGroups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]). You could say the receiver [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] - * is [simplified][org.jetbrains.kotlinx.dataframe.api.SimplifyColumnsSelectionDsl.simplify] before the operation is performed: - * - * [cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]`(a, a, a.b, a.b).`[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]`(a.b)` - * - * `== `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]`(a).`[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]`(a.b)` - * - * ### In the [ColumnsSelectionDsl][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] - * Instead of having to write [all][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.all]`() `[except][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.except]` { ... }` in the DSL, - * you can use [allExcept][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allExcept]` { ... }` to achieve the same result. - * - * For example: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[allExcept][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.allExcept]` { userData.age `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` height } }` - * - * ### On [ColumnGroups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] - * The variant of this function on [ColumnGroups][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] is a bit different as it changes the scope relative to - * the column group. - * - *      - * - * In other words: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColGroup.`[allColsExcept][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.allColsExcept]` { colA `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` colB } }` - * - * is shorthand for - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColGroup.`[select][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.select]` { `[all][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.all]`() `[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]` { colA `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` colB } } }` - * - * or - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { myColGroup.`[allCols][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols]`() `[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]` { myColGroup.colA `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` myColGroup.colB } }` - * - *      - * - * Also note the name change, similar to [allCols][org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.allCols], this makes it clearer that you're selecting - * columns inside the group, 'lifting' them out. - * - * ### Examples for this overload - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.select]` { ``DataSchemaPerson::userData.`[allColsExcept][KProperty.allColsExcept]` { "age" `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` height }`` }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.select]` { city `[and][org.jetbrains.kotlinx.dataframe.api.AndColumnsSelectionDsl.and]` ``Person::name.`[allColsExcept][KProperty.allColsExcept]` { firstName }`` }` - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * @param [selector] A lambda in which you specify the columns that need to be - * excluded from the current selection in [this] column group. The other columns will be included in the selection - * by default. The scope of the selector is relative to the column group. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing all columns in [this] except the specified ones. - * @see ColumnsSelectionDsl.select - * @see ColumnsSelectionDsl.all - * @see ColumnsSelectionDsl.allBefore - * @see ColumnsSelectionDsl.allAfter - * @see ColumnsSelectionDsl.allUpTo - * @see ColumnsSelectionDsl.allFrom - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsExcept") - public fun KProperty>.allColsExcept(selector: ColumnsSelector): ColumnSet<*> = - columnGroup(this).allColsExcept(selector) - @Deprecated( message = ALL_COLS_EXCEPT, replaceWith = ReplaceWith(ALL_COLS_REPLACE), @@ -4125,40 +4018,9 @@ public interface AllExceptColumnsSelectionDsl { * are deleted. */ @ExperimentalExceptCsDsl - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public infix fun KProperty.exceptNew(selector: ColumnsSelector): SingleColumn> = columnGroup(this).exceptExperimentalInternal(selector.toColumns()) - /** - * ## EXPERIMENTAL: Except on Column Group - * - * Selects the current column group itself, except for the specified columns. This is different from - * [allColsExcept][org.jetbrains.kotlinx.dataframe.api.AllExceptColumnsSelectionDsl.allColsExcept] in that it does not 'lift' the columns out of the group, but instead selects the group itself. - * - * As usual, all overloads for each [Access API][org.jetbrains.kotlinx.dataframe.documentation.AccessApi] are available. - * - * These produce the same result: - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { `[cols][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.cols]`(colGroup) `[except][org.jetbrains.kotlinx.dataframe.columns.ColumnSet.except]` colGroup.col }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { colGroup `[exceptNew][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.except]` { col } }` - * - * These functions are experimental and may be removed or changed in the future. - * - * Trying these functions requires you to `@`[`OptIn`][OptIn]`(`[ExperimentalExceptCsDsl][org.jetbrains.kotlinx.dataframe.api.ExperimentalExceptCsDsl]`::class)` first. - * - * ## NOTE: - * `exceptNew` will likely be renamed to `except` when the deprecated [SingleColumn.except][org.jetbrains.kotlinx.dataframe.columns.SingleColumn.except] functions - * are deleted. - */ - @ExperimentalExceptCsDsl - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowExceptNew") - public infix fun KProperty>.exceptNew(selector: ColumnsSelector): SingleColumn> = - columnGroup(this).exceptExperimentalInternal(selector.toColumns()) - @ExperimentalExceptCsDsl @Deprecated( message = ALL_COLS_EXCEPT, diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt index 095f75bff2..d46d075317 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Col [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface ColColumnsSelectionDsl { +public interface ColColumnsSelectionDsl { /** * ## Col Grammar diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt index 5ef4190100..1fab17a5fc 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Column Group [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface ColGroupColumnsSelectionDsl { +public interface ColGroupColumnsSelectionDsl { /** * ## Col Group Grammar diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt index b417104366..2b07d6fdf4 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.transform @@ -28,8 +29,9 @@ import kotlin.reflect.KProperty * ## Cols [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface ColsColumnsSelectionDsl { +public interface ColsColumnsSelectionDsl { /** * ## Cols Grammar diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt index 6f4b3fc8ad..ec4b36117c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Frame Col [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface FrameColColumnsSelectionDsl { +public interface FrameColColumnsSelectionDsl { /** * ## Frame Col Grammar diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index 9e112c1eb6..48decfea4c 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -435,64 +435,9 @@ public interface SelectColumnsSelectionDsl { * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector]. * @see [SingleColumn.except] */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.select(selector: ColumnsSelector): ColumnSet = columnGroup(this).select(selector) - /** - * ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] - * - * Perform a selection of columns using the [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] on - * 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 - * operations of the DSL are at your disposal. - * - * The scope of the new DSL instance is relative to - * the [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] you are selecting from. - * - * The [invoke][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.invoke] operator is overloaded to work as a shortcut for this method. - * - * ### Check out: [Grammar][org.jetbrains.kotlinx.dataframe.api.SelectColumnsSelectionDsl.Grammar] - * - * #### For example: - * - * `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]`>() } }` - * - * `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]` }` - * - * `df.`[select][org.jetbrains.kotlinx.dataframe.DataFrame.select]` { "pathTo"["myGroupCol"].`[select][org.jetbrains.kotlinx.dataframe.columns.ColumnPath.select]` { "colA" and "colB" } }` - * - * `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]` }` - * - * #### Examples for this overload: - * - * `df.`[select][DataFrame.select]` { Type::myColGroup.`[select][KProperty.select]` { someCol `[and][ColumnsSelectionDsl.and]` `[colsOf][SingleColumn.colsOf]`<`[String][String]`>() } }` - * - * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[and][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` - * - * ## NOTE: - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * - * - *      - * - * - * 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. - * - * @param [selector] The [ColumnsSelector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] to use for the selection. - * @receiver The [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] to select from. - * @throws [IllegalArgumentException] If [this] is not a [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup]. - * @return A [ColumnSet][org.jetbrains.kotlinx.dataframe.columns.ColumnSet] containing the columns selected by [selector]. - * @see [SingleColumn.except] - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowSelect") - public fun KProperty>.select(selector: ColumnsSelector): ColumnSet = - columnGroup(this).select(selector) - /** * ## Select from [ColumnGroup][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup] * diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt index 0530acb549..872eccd6cd 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt @@ -4,6 +4,7 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnGroupAccessor import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnGroupName import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnSetName import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.PlainDslName @@ -17,6 +18,7 @@ import org.jetbrains.kotlinx.dataframe.columns.ValueColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +32,9 @@ import kotlin.reflect.KProperty * ## Value Col [Columns Selection DSL][org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl] * * See [Grammar] for all functions in this interface. + * @param _UNUSED [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ -public interface ValueColColumnsSelectionDsl { +public interface ValueColColumnsSelectionDsl { /** * ## Value Col Grammar diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt index cd58165672..48dde1c290 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt @@ -17,11 +17,21 @@ import org.jetbrains.kotlinx.dataframe.api.asSingleColumn public interface ColumnSet : ColumnsResolver internal fun ColumnsResolver.asColumnSet(): ColumnSet = - object : ColumnSet, ColumnsResolver by this {} + when (this) { + is ColumnSet -> this + else -> object : ColumnSet { + override fun resolve(context: ColumnResolutionContext): List> = + this@asColumnSet.resolve(context) + } + } +@Suppress("UNCHECKED_CAST") @PublishedApi internal fun SingleColumn.asColumnSet(): ColumnSet = - object : ColumnSet, SingleColumn by this {} + when (this) { + is ColumnSet<*> -> this as ColumnSet + else -> object : ColumnSet, SingleColumn by this {} + } internal fun ColumnsSelectionDsl.asColumnSet(): ColumnSet> = asSingleColumn().asColumnSet() diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt index 1827fdeca5..08568998c8 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt @@ -19,7 +19,7 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.* * @see [TransformableColumnSet] * @see [TransformableSingleColumn] */ -public interface ColumnsResolver { +public sealed interface ColumnsResolver { /** * Resolves this [ColumnsResolver] as a [List]<[ColumnWithPath]<[C]>>. diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt index d949bf638c..c5c45709b0 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt @@ -1,75 +1,3 @@ package org.jetbrains.kotlinx.dataframe.documentation -internal interface DocumentationUrls { - /** https://kotlin.github.io/dataframe */ - interface Url - - /** [See Access APIs on the documentation website.](https://kotlin.github.io/dataframe/apilevels.html) */ - interface AccessApis { - - /** [See String API on the documentation website.](https://kotlin.github.io/dataframe/stringapi.html) */ - interface StringApi - - /** [See Column Accessors API on the documentation website.](https://kotlin.github.io/dataframe/columnaccessorsapi.html) */ - interface ColumnAccessorsApi - - /** [See KProperties API on the documentation website.](https://kotlin.github.io/dataframe/kpropertiesapi.html) */ - interface KPropertiesApi - - /** [See Extension Properties API on the documentation website.](https://kotlin.github.io/dataframe/extensionpropertiesapi.html) */ - interface ExtensionPropertiesApi - } - - /** [See Column Selectors on the documentation website.](https://kotlin.github.io/dataframe/columnselectors.html) */ - interface ColumnSelectors - - interface DataRow { - /** [See Row Expressions on the documentation website.](https://kotlin.github.io/dataframe/datarow.html#row-expressions) */ - interface RowExpressions - - /** [See Row Conditions on the documentation website.](https://kotlin.github.io/dataframe/datarow.html#row-conditions) */ - interface RowConditions - } - - /** [See `drop` on the documentation website.](https://kotlin.github.io/dataframe/drop.html) */ - interface Drop { - - /** [See `dropNulls` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnulls) */ - interface DropNulls - - /** [See `dropNaNs` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropnans) */ - interface DropNaNs - - /** [See `dropNA` on the documentation website.](https://kotlin.github.io/dataframe/drop.html#dropna) */ - interface DropNA - } - - /** [See `fill` on the documentation website.](https://kotlin.github.io/dataframe/fill.html) */ - interface Fill { - /** [See `fillNulls` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnulls) */ - interface FillNulls - - /** [See `fillNaNs` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillnans) */ - interface FillNaNs - - /** [See `fillNA` on the documentation website.](https://kotlin.github.io/dataframe/fill.html#fillna) */ - interface FillNA - } - - /** [See `NaN` and `NA` on the documentation website.](https://kotlin.github.io/dataframe/nanAndNa.html) */ - interface NanAndNa { - - /** [See `NaN` on the documentation website.](https://kotlin.github.io/dataframe/nanAndNa.html#nan) */ - interface NaN - - /** [See `NA` on the documentation website.](https://kotlin.github.io/dataframe/nanAndNa.html#na) */ - interface NA - } - - /** [See `select` on the documentation website.](https://kotlin.github.io/dataframe/select.html) */ - interface Select - - /** [See `update` on the documentation website.](https://kotlin.github.io/dataframe/update.html) */ - interface Update -} diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt new file mode 100644 index 0000000000..c5c45709b0 --- /dev/null +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt @@ -0,0 +1,3 @@ +package org.jetbrains.kotlinx.dataframe.documentation + + diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt index e0e0c30750..d7d8972d21 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt @@ -5,23 +5,40 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnResolutionContext import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver +import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.shortPath internal class ConfiguredAggregateColumn private constructor( val columns: ColumnsResolver, private val default: C? = null, private val newPath: ColumnPath? = null, -) : ColumnSet { +) : SingleColumn, ColumnSet { private fun ColumnWithPath.toDescriptor(keepName: Boolean): AggregateColumnDescriptor = when (val col = this) { is AggregateColumnDescriptor -> { - val path = if (keepName) newPath?.plus(col.newPath ?: col.column.shortPath()) ?: col.newPath - else newPath ?: col.newPath - AggregateColumnDescriptor(col.column, default ?: col.default, path) + // Fix for K2 smart-casting changes + val currentDefault = this@ConfiguredAggregateColumn.default + val currentNewPath = this@ConfiguredAggregateColumn.newPath + + val newPath = when { + currentNewPath == null -> col.newPath + keepName -> currentNewPath + (col.newPath ?: col.column.shortPath()) + else -> currentNewPath + } + AggregateColumnDescriptor( + column = col.column, + default = currentDefault ?: col.default, + newPath = newPath, + ) } - else -> AggregateColumnDescriptor(col, default, if (keepName) newPath?.plus(col.name) else newPath) + else -> + AggregateColumnDescriptor( + column = col, + default = default, + newPath = if (keepName) newPath?.plus(col.name) else newPath, + ) } private fun resolve(context: ColumnResolutionContext, columns: ColumnsResolver): List> { @@ -38,16 +55,33 @@ internal class ConfiguredAggregateColumn private constructor( override fun resolve(context: ColumnResolutionContext): List> = resolve(context, columns) + override fun resolveSingle(context: ColumnResolutionContext): ColumnWithPath? = + resolve(context, columns).singleOrNull() + companion object { - fun withDefault(src: ColumnsResolver, default: C?): ColumnSet = when (src) { - is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) - else -> ConfiguredAggregateColumn(src, default, null) - } + fun withPath(src: SingleColumn, newPath: ColumnPath): SingleColumn = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) + else -> ConfiguredAggregateColumn(src, null, newPath) + } - fun withPath(src: ColumnsResolver, newPath: ColumnPath): ColumnSet = when (src) { - is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) - else -> ConfiguredAggregateColumn(src, null, newPath) - } + fun withDefault(src: SingleColumn, default: C?): SingleColumn = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) + else -> ConfiguredAggregateColumn(src, default, null) + } + + fun withPath(src: ColumnSet, newPath: ColumnPath): ColumnSet = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) + else -> ConfiguredAggregateColumn(src, null, newPath) + } + + fun withDefault(src: ColumnSet, default: C?): ColumnSet = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) + else -> ConfiguredAggregateColumn(src, default, null) + } } } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt index 4844853ddf..c494e9dceb 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt @@ -40,21 +40,20 @@ internal fun Gather.gatherImpl( // optimization when no filter is applied if (filter == null) { // add key and value columns - df = df.add { // add columns for names and values - if (keysColumn != null) { - keysColumn from { keys } - } - if (valuesColumn != null) { - valuesColumn from { row -> - columnsToGather.map { col -> - val value = col[row] - if (valueTransform != null) { - when { - explode && value is List<*> -> (value as List).map(valueTransform) - else -> valueTransform(value) - } - } else value - } + if (keysColumn != null) { + df = df.add(keysColumn) { keys } + } + + if (valuesColumn != null) { + df = df.add(valuesColumn) { row -> + columnsToGather.map { col -> + val value = col[row] + if (valueTransform != null) { + when { + explode && value is List<*> -> (value as List).map(valueTransform) + else -> valueTransform(value) + } + } else value } } } diff --git a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt index e0a318dd6b..43524aed07 100644 --- a/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt +++ b/core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt @@ -156,11 +156,11 @@ internal object FullyQualifiedNames : TypeRenderingStrategy { internal object ShortNames : TypeRenderingStrategy { - private val DataRow = DataRow::class.simpleName!! - private val ColumnsContainer = ColumnsContainer::class.simpleName!! - private val DataFrame = DataFrame::class.simpleName!! - private val DataColumn = DataColumn::class.simpleName!! - private val ColumnGroup = ColumnGroup::class.simpleName!! + private val DataRow = org.jetbrains.kotlinx.dataframe.DataRow::class.simpleName!! + private val ColumnsContainer = org.jetbrains.kotlinx.dataframe.ColumnsContainer::class.simpleName!! + private val DataFrame = org.jetbrains.kotlinx.dataframe.DataFrame::class.simpleName!! + private val DataColumn = org.jetbrains.kotlinx.dataframe.DataColumn::class.simpleName!! + private val ColumnGroup = org.jetbrains.kotlinx.dataframe.columns.ColumnGroup::class.simpleName!! override fun renderRowTypeName(markerName: String): String = "$DataRow<${markerName.shorten()}>" diff --git a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt index 31719b6b24..d79c814ce9 100644 --- a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt +++ b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt @@ -183,7 +183,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsAfter(pathOf("firstName")) }, df.select { "name".allColsAfter(pathOf("name", "firstName")) }, - df.select { Person::name.allColsAfter { firstName } }, df.select { Person::name.allColsAfter { firstNameAccessor } }, df.select { Person::name.allColsAfter(name.firstName) }, df.select { Person::name.allColsAfter(firstNameAccessor) }, @@ -226,7 +225,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsFrom(pathOf("lastName")) }, df.select { "name".allColsFrom(pathOf("name", "lastName")) }, - df.select { Person::name.allColsFrom { lastName } }, df.select { Person::name.allColsFrom { lastNameAccessor } }, df.select { Person::name.allColsFrom(name.lastName) }, df.select { Person::name.allColsFrom(lastNameAccessor) }, @@ -280,7 +278,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsBefore(pathOf("lastName")) }, df.select { "name".allColsBefore(pathOf("name", "lastName")) }, - df.select { Person::name.allColsBefore { lastName } }, df.select { Person::name.allColsBefore { lastNameAccessor } }, df.select { Person::name.allColsBefore(name.lastName) }, df.select { Person::name.allColsBefore(lastNameAccessor) }, @@ -323,7 +320,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsUpTo(pathOf("firstName")) }, df.select { "name".allColsUpTo(pathOf("name", "firstName")) }, - df.select { Person::name.allColsUpTo { firstName } }, df.select { Person::name.allColsUpTo { firstNameAccessor } }, df.select { Person::name.allColsUpTo(name.firstName) }, df.select { Person::name.allColsUpTo(firstNameAccessor) }, diff --git a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index 6b37c03ac7..6734d144a9 100644 --- a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -176,8 +176,6 @@ class AllExceptTests : ColumnsSelectionDslTests() { // df.select { "name".allColsExcept(pathOf("name", "lastName")) }, // breaks df.select { "name".allColsExcept { cols { "last" in it.name } } }, - df.select { Person::name.allColsExcept { lastName } }, - df.select { Person::name.allColsExcept { lastNameAccessor } }, // df.select { Person::name.allColsExcept(name.lastName) }, // blocked // df.select { Person::name.allColsExcept(lastNameAccessor) }, // blocked df.select { Person::name.allColsExcept("lastName") }, @@ -336,12 +334,6 @@ class AllExceptTests : ColumnsSelectionDslTests() { df.select { "name".exceptNew(pathOf("firstName")) }, df.select { "name".exceptNew(pathOf("firstName"), pathOf("firstName")) }, - df.select { Person::name exceptNew { cols { "first" in it.name } } }, - df.select { Person::name.exceptNew { cols { "first" in it.name } and cols { "first" in it.name } } }, - df.select { Person::name exceptNew { firstName } }, - df.select { Person::name.exceptNew { firstNameAccessor } }, - df.select { Person::name exceptNew { firstName and firstName } }, - df.select { Person::name.exceptNew { firstNameAccessor and firstNameAccessor } }, // df.select { Person::name exceptNew name.firstName }, // not allowed // df.select { Person::name.exceptNew(name.firstName and name.firstName) }, // not allowed // df.select { Person::name exceptNew firstNameAccessor }, // not allowed diff --git a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index efa31d19e6..ab9f343050 100644 --- a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -37,12 +37,8 @@ class SelectTests : ColumnsSelectionDslTests() { df.select { name { colsOf() } }, df.select { (it["name"].asColumnGroup()) { colsOf() } }, - // TODO: remove warning due to [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) - df.select { Person::name.select { firstName and lastName } }, df.select { NonDataSchemaPerson::name.select { firstName and lastName } }, - // TODO: remove warning due to [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) - df.select { Person::name { firstName and lastName } }, df.select { NonDataSchemaPerson::name { firstName and lastName } }, df.select { "name">().select { colsOf() } }, diff --git a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt index 6b3e6d9448..7859c6116f 100644 --- a/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt +++ b/core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.statistics import io.kotest.matchers.shouldBe +import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.api.columnOf import org.jetbrains.kotlinx.dataframe.api.concat import org.jetbrains.kotlinx.dataframe.api.cumSum @@ -43,7 +44,7 @@ class CumsumTests { @Test fun `number column`() { - val doubles by columnOf(1, 2, null, Double.NaN, 4) + val doubles: DataColumn by columnOf(1, 2, null, Double.NaN, 4) doubles.cumSum().toList() shouldBe listOf(1.0, 3.0, Double.NaN, Double.NaN, 7.0) } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt index 5ead992aab..f3d91b35f0 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt @@ -13,17 +13,19 @@ public interface ColumnsForAggregateSelectionDsl : ColumnsSelectionDsl ConfiguredAggregateColumn.withDefault(this, defaultValue) public infix fun SingleColumn.default(defaultValue: C): SingleColumn = - ConfiguredAggregateColumn.withDefault(this, defaultValue).single() + ConfiguredAggregateColumn.withDefault(this, defaultValue) public fun path(vararg names: String): ColumnPath = ColumnPath(names.asList()) - public infix fun ColumnSet.into(name: String): ColumnSet = ConfiguredAggregateColumn.withPath(this, pathOf(name)) + public infix fun ColumnSet.into(name: String): ColumnSet = + ConfiguredAggregateColumn.withPath(this, pathOf(name)) public infix fun SingleColumn.into(name: String): SingleColumn = - ConfiguredAggregateColumn.withPath(this, pathOf(name)).single() + ConfiguredAggregateColumn.withPath(this, pathOf(name)) - public infix fun ColumnSet.into(path: ColumnPath): ColumnSet = ConfiguredAggregateColumn.withPath(this, path) + public infix fun ColumnSet.into(path: ColumnPath): ColumnSet = + ConfiguredAggregateColumn.withPath(this, path) public infix fun SingleColumn.into(path: ColumnPath): SingleColumn = - ConfiguredAggregateColumn.withPath(this, path).single() + ConfiguredAggregateColumn.withPath(this, path) } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt index db7b7e4180..6c0a1dd81c 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt @@ -56,16 +56,16 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ SingleColumnsSelectionDsl, // col(name), col(5), [5] - ColColumnsSelectionDsl, + ColColumnsSelectionDsl, // valueCol(name), valueCol(5) - ValueColColumnsSelectionDsl, + ValueColColumnsSelectionDsl, // frameCol(name), frameCol(5) - FrameColColumnsSelectionDsl, + FrameColColumnsSelectionDsl, // colGroup(name), colGroup(5) - ColGroupColumnsSelectionDsl, + ColGroupColumnsSelectionDsl, // cols {}, cols(), cols(colA, colB), cols(1, 5), cols(1..5), [{}] - ColsColumnsSelectionDsl, + ColsColumnsSelectionDsl, // colA.."colB" ColumnRangeColumnsSelectionDsl, @@ -80,7 +80,7 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ ColsOfKindColumnsSelectionDsl, // all(Cols), allAfter(colA), allBefore(colA), allFrom(colA), allUpTo(colA) - AllColumnsSelectionDsl, + AllColumnsSelectionDsl, // colsAtAnyDepth {}, colsAtAnyDepth() ColsAtAnyDepthColumnsSelectionDsl, // colsInGroups {}, colsInGroups() @@ -388,24 +388,6 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ public operator fun SingleColumn>.invoke(selector: ColumnsSelector): ColumnSet = select(selector) - /** - * @include [SelectColumnsSelectionDsl.CommonSelectDocs] - * @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg] - * - * `df.`[select][DataFrame.select]` { Type::myColGroup.`[`select`][KProperty.select]` { someCol `[`and`][ColumnsSelectionDsl.and]` `[`colsOf`][SingleColumn.colsOf]`<`[`String`][String]`>() } }` - * - * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[`and`][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowInvoke") - public operator fun KProperty>.invoke(selector: ColumnsSelector): ColumnSet = - select(selector) - /** * @include [SelectColumnsSelectionDsl.CommonSelectDocs] * @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg] @@ -414,8 +396,6 @@ public interface ColumnsSelectionDsl : /* SingleColumn> */ * * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[`and`][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType public operator fun KProperty.invoke(selector: ColumnsSelector): ColumnSet = columnGroup(this).select(selector) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt index f11f6d86d1..b16fc003da 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubse import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionArg import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.FunctionColsArg import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.CommonAllSubsetDocs.TitleArg +import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.After import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.Before import org.jetbrains.kotlinx.dataframe.api.AllColumnsSelectionDsl.Grammar.ColumnGroupName @@ -36,6 +37,7 @@ import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.ExcludeFromSources import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.addPath @@ -88,8 +90,9 @@ public fun DataFrame.all(predicate: RowFilter): Boolean = rows().all { * ## All Flavors of All (Cols) {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface AllColumnsSelectionDsl { +public interface AllColumnsSelectionDsl { /** * ## Grammar of All Flavors of All (Cols): @@ -503,11 +506,6 @@ public interface AllColumnsSelectionDsl { * @set [CommonAllSubsetDocs.ExampleArg] * * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup.`[allColsAfter][KProperty.allColsAfter]`{@get [KPropertyAllAfterDocs.Arg]} }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). */ @ExcludeFromSources private interface KPropertyAllAfterDocs { @@ -519,20 +517,9 @@ public interface AllColumnsSelectionDsl { /** * @include [KPropertyAllAfterDocs] {@set [KPropertyAllAfterDocs.Arg] \ \{ myColumn \}} */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsAfter(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsAfter(column) - /** - * @include [KPropertyAllAfterDocs] {@set [KPropertyAllAfterDocs.Arg] \ \{ myColumn \}} - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsAfter") - public fun KProperty>.allColsAfter(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsAfter(column) - /** @include [KPropertyAllAfterDocs] {@set [KPropertyAllAfterDocs.Arg] ("pathTo"["myColumn"])} */ public fun KProperty<*>.allColsAfter(column: ColumnPath): ColumnSet<*> = columnGroup(this).allColsAfter(column) @@ -750,11 +737,6 @@ public interface AllColumnsSelectionDsl { * @set [CommonAllSubsetDocs.ExampleArg] * * `df.`[select][DataFrame.select]` { DataSchemaType::someColGroup.`[allColsFrom][KProperty.allColsFrom]`{@get [KPropertyAllFromDocs.Arg]} }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). */ @ExcludeFromSources private interface KPropertyAllFromDocs { @@ -766,20 +748,9 @@ public interface AllColumnsSelectionDsl { /** * @include [KPropertyAllFromDocs] {@set [KPropertyAllFromDocs.Arg] \ \{ myColumn \}} */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsFrom(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsFrom(column) - /** - * @include [KPropertyAllFromDocs] {@set [KPropertyAllFromDocs.Arg] \ \{ myColumn \}} - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsFrom") - public fun KProperty>.allColsFrom(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsFrom(column) - /** @include [KPropertyAllFromDocs] {@set [KPropertyAllFromDocs.Arg] ("pathTo"["myColumn"])} */ public fun KProperty<*>.allColsFrom(column: ColumnPath): ColumnSet<*> = columnGroup(this).allColsFrom(column) @@ -994,11 +965,6 @@ public interface AllColumnsSelectionDsl { * @set [CommonAllSubsetDocs.ExampleArg] * * `df.`[select][DataFrame.select]` { DataSchemaType::someColGroup.`[allColsBefore][KProperty.allColsBefore]`{@get [KPropertyAllBeforeDocs.Arg]} }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). */ @ExcludeFromSources private interface KPropertyAllBeforeDocs { @@ -1010,20 +976,9 @@ public interface AllColumnsSelectionDsl { /** * @include [KPropertyAllBeforeDocs] {@set [KPropertyAllBeforeDocs.Arg] \ \{ myColumn \}} */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsBefore(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsBefore(column) - /** - * @include [KPropertyAllBeforeDocs] {@set [KPropertyAllBeforeDocs.Arg] \ \{ myColumn \}} - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsBefore") - public fun KProperty>.allColsBefore(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsBefore(column) - /** @include [KPropertyAllBeforeDocs] {@set [KPropertyAllBeforeDocs.Arg] ("pathTo"["myColumn"])} */ public fun KProperty<*>.allColsBefore(column: ColumnPath): ColumnSet<*> = columnGroup(this).allColsBefore(column) @@ -1241,11 +1196,6 @@ public interface AllColumnsSelectionDsl { * @set [CommonAllSubsetDocs.ExampleArg] * * `df.`[select][DataFrame.select]` { DataSchemaType::someColGroup.`[allColsUpTo][KProperty.allColsUpTo]`{@get [KPropertyAllUpToDocs.Arg]} }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). */ @ExcludeFromSources private interface KPropertyAllUpToDocs { @@ -1257,20 +1207,9 @@ public interface AllColumnsSelectionDsl { /** * @include [KPropertyAllUpToDocs] {@set [KPropertyAllUpToDocs.Arg] \ \{ myColumn \}} */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsUpTo(column: ColumnSelector): ColumnSet<*> = columnGroup(this).allColsUpTo(column) - /** - * @include [KPropertyAllUpToDocs] {@set [KPropertyAllUpToDocs.Arg] \ \{ myColumn \}} - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsUpTo") - public fun KProperty>.allColsUpTo(column: ColumnSelector): ColumnSet<*> = - columnGroup(this).allColsUpTo(column) - /** @include [KPropertyAllUpToDocs] {@set [KPropertyAllUpToDocs.Arg] ("pathTo"["myColumn"])} */ public fun KProperty<*>.allColsUpTo(column: ColumnPath): ColumnSet<*> = columnGroup(this).allColsUpTo(column) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index 2ef996e0cb..1400cfe10f 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -581,33 +581,12 @@ public interface AllExceptColumnsSelectionDsl { /** * @include [ColumnGroupDocs] - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). * @include [ColumnGroupDocs.KPropertyReceiverArgs] * @include [ColumnGroupDocs.SelectorArgs] */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.allColsExcept(selector: ColumnsSelector): ColumnSet<*> = columnGroup(this).allColsExcept(selector) - /** - * @include [ColumnGroupDocs] - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - * @include [ColumnGroupDocs.KPropertyReceiverArgs] - * @include [ColumnGroupDocs.SelectorArgs] - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowAllColsExcept") - public fun KProperty>.allColsExcept(selector: ColumnsSelector): ColumnSet<*> = - columnGroup(this).allColsExcept(selector) - @Deprecated( message = ALL_COLS_EXCEPT, replaceWith = ReplaceWith(ALL_COLS_REPLACE), @@ -866,21 +845,9 @@ public interface AllExceptColumnsSelectionDsl { * @include [ExperimentalExceptDocs] */ @ExperimentalExceptCsDsl - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public infix fun KProperty.exceptNew(selector: ColumnsSelector): SingleColumn> = columnGroup(this).exceptExperimentalInternal(selector.toColumns()) - /** - * @include [ExperimentalExceptDocs] - */ - @ExperimentalExceptCsDsl - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowExceptNew") - public infix fun KProperty>.exceptNew(selector: ColumnsSelector): SingleColumn> = - columnGroup(this).exceptExperimentalInternal(selector.toColumns()) - @ExperimentalExceptCsDsl @Deprecated( message = ALL_COLS_EXCEPT, diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt index 822bc7889a..80a5a7587d 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/col.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Col {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface ColColumnsSelectionDsl { +public interface ColColumnsSelectionDsl { /** * ## Col Grammar diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt index 46114b854b..0f4282237c 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroup.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Column Group {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface ColGroupColumnsSelectionDsl { +public interface ColGroupColumnsSelectionDsl { /** * ## Col Group Grammar diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt index 159e174b82..1af2154691 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/cols.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.transform @@ -28,8 +29,9 @@ import kotlin.reflect.KProperty * ## Cols {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface ColsColumnsSelectionDsl { +public interface ColsColumnsSelectionDsl { /** * ## Cols Grammar diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt index 26e42aac9a..09b7dde412 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/frameCol.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +31,9 @@ import kotlin.reflect.KProperty * ## Frame Col {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface FrameColColumnsSelectionDsl { +public interface FrameColColumnsSelectionDsl { /** * ## Frame Col Grammar diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index 68dc26a6cb..2d55ec5505 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -183,30 +183,9 @@ public interface SelectColumnsSelectionDsl { * * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[and][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` */ - @OptIn(ExperimentalTypeInference::class) - @OverloadResolutionByLambdaReturnType - // TODO: [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) public fun KProperty.select(selector: ColumnsSelector): ColumnSet = columnGroup(this).select(selector) - /** - * @include [CommonSelectDocs] - * @set [CommonSelectDocs.ExampleArg] - * - * `df.`[select][DataFrame.select]` { Type::myColGroup.`[select][KProperty.select]` { someCol `[and][ColumnsSelectionDsl.and]` `[colsOf][SingleColumn.colsOf]`<`[String][String]`>() } }` - * - * `df.`[select][DataFrame.select]` { DataSchemaType::myColGroup `[`{`][KProperty.select]` colA `[and][ColumnsSelectionDsl.and]` colB `[`}`][KProperty.select]` }` - * - * ## NOTE: {@comment TODO fix warning} - * If you get a warning `CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION`, you - * can safely ignore this. It is caused by a workaround for a bug in the Kotlin compiler - * ([KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument)). - */ - @Suppress("INAPPLICABLE_JVM_NAME") - @JvmName("KPropertyDataRowSelect") - public fun KProperty>.select(selector: ColumnsSelector): ColumnSet = - columnGroup(this).select(selector) - /** * @include [SelectColumnsSelectionDsl.CommonSelectDocs] * @set [SelectColumnsSelectionDsl.CommonSelectDocs.ExampleArg] diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt index a6622737aa..9d69b284cf 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCol.kt @@ -4,6 +4,7 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnGroupAccessor import org.jetbrains.kotlinx.dataframe.ColumnGroupReference import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnGroupName import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.ColumnSetName import org.jetbrains.kotlinx.dataframe.api.ValueColColumnsSelectionDsl.Grammar.PlainDslName @@ -17,6 +18,7 @@ import org.jetbrains.kotlinx.dataframe.columns.ValueColumn import org.jetbrains.kotlinx.dataframe.documentation.AccessApiLink import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent +import org.jetbrains.kotlinx.dataframe.documentation.Issues import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.getAt import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve @@ -30,8 +32,9 @@ import kotlin.reflect.KProperty * ## Value Col {@include [ColumnsSelectionDslLink]} * * See [Grammar] for all functions in this interface. + * @param _UNUSED {@include [Issues.ConflictingOverloadsK2Link]} */ -public interface ValueColColumnsSelectionDsl { +public interface ValueColColumnsSelectionDsl { /** * ## Value Col Grammar diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt index cd58165672..48dde1c290 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnSet.kt @@ -17,11 +17,21 @@ import org.jetbrains.kotlinx.dataframe.api.asSingleColumn public interface ColumnSet : ColumnsResolver internal fun ColumnsResolver.asColumnSet(): ColumnSet = - object : ColumnSet, ColumnsResolver by this {} + when (this) { + is ColumnSet -> this + else -> object : ColumnSet { + override fun resolve(context: ColumnResolutionContext): List> = + this@asColumnSet.resolve(context) + } + } +@Suppress("UNCHECKED_CAST") @PublishedApi internal fun SingleColumn.asColumnSet(): ColumnSet = - object : ColumnSet, SingleColumn by this {} + when (this) { + is ColumnSet<*> -> this as ColumnSet + else -> object : ColumnSet, SingleColumn by this {} + } internal fun ColumnsSelectionDsl.asColumnSet(): ColumnSet> = asSingleColumn().asColumnSet() diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt index 1827fdeca5..08568998c8 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnsResolver.kt @@ -19,7 +19,7 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.* * @see [TransformableColumnSet] * @see [TransformableSingleColumn] */ -public interface ColumnsResolver { +public sealed interface ColumnsResolver { /** * Resolves this [ColumnsResolver] as a [List]<[ColumnWithPath]<[C]>>. diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt index a5da0ed5cb..331b50a3f7 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt @@ -1,5 +1,6 @@ package org.jetbrains.kotlinx.dataframe.documentation +@ExcludeFromSources internal interface DocumentationUrls { /** https://kotlin.github.io/dataframe */ diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt new file mode 100644 index 0000000000..46a3c7c777 --- /dev/null +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/Issues.kt @@ -0,0 +1,8 @@ +package org.jetbrains.kotlinx.dataframe.documentation + +@ExcludeFromSources +internal interface Issues { + + /** [#KT-68546](https://youtrack.jetbrains.com/issue/KT-68546/Conflicting-overloads-in-non-generic-interface-K2-2.0.0) */ + interface ConflictingOverloadsK2Link +} diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt index e0e0c30750..d7d8972d21 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation/ConfiguredAggregateColumn.kt @@ -5,23 +5,40 @@ import org.jetbrains.kotlinx.dataframe.columns.ColumnResolutionContext import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnWithPath import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver +import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.columns.shortPath internal class ConfiguredAggregateColumn private constructor( val columns: ColumnsResolver, private val default: C? = null, private val newPath: ColumnPath? = null, -) : ColumnSet { +) : SingleColumn, ColumnSet { private fun ColumnWithPath.toDescriptor(keepName: Boolean): AggregateColumnDescriptor = when (val col = this) { is AggregateColumnDescriptor -> { - val path = if (keepName) newPath?.plus(col.newPath ?: col.column.shortPath()) ?: col.newPath - else newPath ?: col.newPath - AggregateColumnDescriptor(col.column, default ?: col.default, path) + // Fix for K2 smart-casting changes + val currentDefault = this@ConfiguredAggregateColumn.default + val currentNewPath = this@ConfiguredAggregateColumn.newPath + + val newPath = when { + currentNewPath == null -> col.newPath + keepName -> currentNewPath + (col.newPath ?: col.column.shortPath()) + else -> currentNewPath + } + AggregateColumnDescriptor( + column = col.column, + default = currentDefault ?: col.default, + newPath = newPath, + ) } - else -> AggregateColumnDescriptor(col, default, if (keepName) newPath?.plus(col.name) else newPath) + else -> + AggregateColumnDescriptor( + column = col, + default = default, + newPath = if (keepName) newPath?.plus(col.name) else newPath, + ) } private fun resolve(context: ColumnResolutionContext, columns: ColumnsResolver): List> { @@ -38,16 +55,33 @@ internal class ConfiguredAggregateColumn private constructor( override fun resolve(context: ColumnResolutionContext): List> = resolve(context, columns) + override fun resolveSingle(context: ColumnResolutionContext): ColumnWithPath? = + resolve(context, columns).singleOrNull() + companion object { - fun withDefault(src: ColumnsResolver, default: C?): ColumnSet = when (src) { - is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) - else -> ConfiguredAggregateColumn(src, default, null) - } + fun withPath(src: SingleColumn, newPath: ColumnPath): SingleColumn = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) + else -> ConfiguredAggregateColumn(src, null, newPath) + } - fun withPath(src: ColumnsResolver, newPath: ColumnPath): ColumnSet = when (src) { - is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) - else -> ConfiguredAggregateColumn(src, null, newPath) - } + fun withDefault(src: SingleColumn, default: C?): SingleColumn = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) + else -> ConfiguredAggregateColumn(src, default, null) + } + + fun withPath(src: ColumnSet, newPath: ColumnPath): ColumnSet = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, src.default, newPath) + else -> ConfiguredAggregateColumn(src, null, newPath) + } + + fun withDefault(src: ColumnSet, default: C?): ColumnSet = + when (src) { + is ConfiguredAggregateColumn -> ConfiguredAggregateColumn(src.columns, default, src.newPath) + else -> ConfiguredAggregateColumn(src, default, null) + } } } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt index 4844853ddf..c494e9dceb 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt @@ -40,21 +40,20 @@ internal fun Gather.gatherImpl( // optimization when no filter is applied if (filter == null) { // add key and value columns - df = df.add { // add columns for names and values - if (keysColumn != null) { - keysColumn from { keys } - } - if (valuesColumn != null) { - valuesColumn from { row -> - columnsToGather.map { col -> - val value = col[row] - if (valueTransform != null) { - when { - explode && value is List<*> -> (value as List).map(valueTransform) - else -> valueTransform(value) - } - } else value - } + if (keysColumn != null) { + df = df.add(keysColumn) { keys } + } + + if (valuesColumn != null) { + df = df.add(valuesColumn) { row -> + columnsToGather.map { col -> + val value = col[row] + if (valueTransform != null) { + when { + explode && value is List<*> -> (value as List).map(valueTransform) + else -> valueTransform(value) + } + } else value } } } diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt index e0a318dd6b..43524aed07 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt @@ -156,11 +156,11 @@ internal object FullyQualifiedNames : TypeRenderingStrategy { internal object ShortNames : TypeRenderingStrategy { - private val DataRow = DataRow::class.simpleName!! - private val ColumnsContainer = ColumnsContainer::class.simpleName!! - private val DataFrame = DataFrame::class.simpleName!! - private val DataColumn = DataColumn::class.simpleName!! - private val ColumnGroup = ColumnGroup::class.simpleName!! + private val DataRow = org.jetbrains.kotlinx.dataframe.DataRow::class.simpleName!! + private val ColumnsContainer = org.jetbrains.kotlinx.dataframe.ColumnsContainer::class.simpleName!! + private val DataFrame = org.jetbrains.kotlinx.dataframe.DataFrame::class.simpleName!! + private val DataColumn = org.jetbrains.kotlinx.dataframe.DataColumn::class.simpleName!! + private val ColumnGroup = org.jetbrains.kotlinx.dataframe.columns.ColumnGroup::class.simpleName!! override fun renderRowTypeName(markerName: String): String = "$DataRow<${markerName.shorten()}>" diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt index 31719b6b24..d79c814ce9 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/all.kt @@ -183,7 +183,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsAfter(pathOf("firstName")) }, df.select { "name".allColsAfter(pathOf("name", "firstName")) }, - df.select { Person::name.allColsAfter { firstName } }, df.select { Person::name.allColsAfter { firstNameAccessor } }, df.select { Person::name.allColsAfter(name.firstName) }, df.select { Person::name.allColsAfter(firstNameAccessor) }, @@ -226,7 +225,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsFrom(pathOf("lastName")) }, df.select { "name".allColsFrom(pathOf("name", "lastName")) }, - df.select { Person::name.allColsFrom { lastName } }, df.select { Person::name.allColsFrom { lastNameAccessor } }, df.select { Person::name.allColsFrom(name.lastName) }, df.select { Person::name.allColsFrom(lastNameAccessor) }, @@ -280,7 +278,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsBefore(pathOf("lastName")) }, df.select { "name".allColsBefore(pathOf("name", "lastName")) }, - df.select { Person::name.allColsBefore { lastName } }, df.select { Person::name.allColsBefore { lastNameAccessor } }, df.select { Person::name.allColsBefore(name.lastName) }, df.select { Person::name.allColsBefore(lastNameAccessor) }, @@ -323,7 +320,6 @@ class AllTests : ColumnsSelectionDslTests() { df.select { "name".allColsUpTo(pathOf("firstName")) }, df.select { "name".allColsUpTo(pathOf("name", "firstName")) }, - df.select { Person::name.allColsUpTo { firstName } }, df.select { Person::name.allColsUpTo { firstNameAccessor } }, df.select { Person::name.allColsUpTo(name.firstName) }, df.select { Person::name.allColsUpTo(firstNameAccessor) }, diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt index 6b37c03ac7..6734d144a9 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt @@ -176,8 +176,6 @@ class AllExceptTests : ColumnsSelectionDslTests() { // df.select { "name".allColsExcept(pathOf("name", "lastName")) }, // breaks df.select { "name".allColsExcept { cols { "last" in it.name } } }, - df.select { Person::name.allColsExcept { lastName } }, - df.select { Person::name.allColsExcept { lastNameAccessor } }, // df.select { Person::name.allColsExcept(name.lastName) }, // blocked // df.select { Person::name.allColsExcept(lastNameAccessor) }, // blocked df.select { Person::name.allColsExcept("lastName") }, @@ -336,12 +334,6 @@ class AllExceptTests : ColumnsSelectionDslTests() { df.select { "name".exceptNew(pathOf("firstName")) }, df.select { "name".exceptNew(pathOf("firstName"), pathOf("firstName")) }, - df.select { Person::name exceptNew { cols { "first" in it.name } } }, - df.select { Person::name.exceptNew { cols { "first" in it.name } and cols { "first" in it.name } } }, - df.select { Person::name exceptNew { firstName } }, - df.select { Person::name.exceptNew { firstNameAccessor } }, - df.select { Person::name exceptNew { firstName and firstName } }, - df.select { Person::name.exceptNew { firstNameAccessor and firstNameAccessor } }, // df.select { Person::name exceptNew name.firstName }, // not allowed // df.select { Person::name.exceptNew(name.firstName and name.firstName) }, // not allowed // df.select { Person::name exceptNew firstNameAccessor }, // not allowed diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt index efa31d19e6..ab9f343050 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt @@ -37,12 +37,8 @@ class SelectTests : ColumnsSelectionDslTests() { df.select { name { colsOf() } }, df.select { (it["name"].asColumnGroup()) { colsOf() } }, - // TODO: remove warning due to [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) - df.select { Person::name.select { firstName and lastName } }, df.select { NonDataSchemaPerson::name.select { firstName and lastName } }, - // TODO: remove warning due to [KT-64092](https://youtrack.jetbrains.com/issue/KT-64092/OVERLOADRESOLUTIONAMBIGUITY-caused-by-lambda-argument) - df.select { Person::name { firstName and lastName } }, df.select { NonDataSchemaPerson::name { firstName and lastName } }, df.select { "name">().select { colsOf() } }, diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt index 6b3e6d9448..7859c6116f 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/cumsum.kt @@ -1,6 +1,7 @@ package org.jetbrains.kotlinx.dataframe.statistics import io.kotest.matchers.shouldBe +import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.api.columnOf import org.jetbrains.kotlinx.dataframe.api.concat import org.jetbrains.kotlinx.dataframe.api.cumSum @@ -43,7 +44,7 @@ class CumsumTests { @Test fun `number column`() { - val doubles by columnOf(1, 2, null, Double.NaN, 4) + val doubles: DataColumn by columnOf(1, 2, null, Double.NaN, 4) doubles.cumSum().toList() shouldBe listOf(1.0, 3.0, Double.NaN, Double.NaN, 7.0) }