From dfb46f18d99fd631865dbaffae7b634aca79ff21 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Mon, 23 Sep 2024 12:23:21 +0200 Subject: [PATCH] updating deprecations post 0.14 --- .../dataframe/api/ColumnsSelectionDsl.kt | 24 +--- .../jetbrains/kotlinx/dataframe/api/all.kt | 134 ------------------ .../kotlinx/dataframe/api/allExcept.kt | 113 --------------- .../kotlinx/dataframe/api/colGroups.kt | 32 ----- .../kotlinx/dataframe/api/colsAtAnyDepth.kt | 24 ---- .../kotlinx/dataframe/api/colsInGroups.kt | 44 ------ .../jetbrains/kotlinx/dataframe/api/select.kt | 30 ---- .../kotlinx/dataframe/api/simplify.kt | 8 -- .../dataframe/columns/ColumnWithPath.kt | 40 ------ .../dataframe/util/deprecationMessages.kt | 71 +--------- 10 files changed, 10 insertions(+), 510 deletions(-) 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 b782cb0dcb..a9eb9cd298 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 @@ -1,9 +1,12 @@ package org.jetbrains.kotlinx.dataframe.api import org.jetbrains.kotlinx.dataframe.ColumnsSelector -import org.jetbrains.kotlinx.dataframe.DataColumn import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnGroupPartOfGrammar +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.ColumnSetPartOfGrammar +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.DefinitionsPartOfGrammar +import org.jetbrains.kotlinx.dataframe.api.ColumnsSelectionDsl.DslGrammar.PlainDslPartOfGrammar import org.jetbrains.kotlinx.dataframe.columns.ColumnPath import org.jetbrains.kotlinx.dataframe.columns.ColumnSet import org.jetbrains.kotlinx.dataframe.columns.ColumnsResolver @@ -16,9 +19,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.impl.DataFrameReceiver -import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnsList -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_LIST_DATACOLUMN_GET -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_LIST_DATACOLUMN_GET_REPLACE import kotlin.reflect.KProperty /** [Columns Selection DSL][ColumnsSelectionDsl] */ @@ -380,22 +380,6 @@ public interface ColumnsSelectionDsl : // SingleColumn> public operator fun ColumnsSelector.invoke(): ColumnsResolver = this@invoke(this@ColumnsSelectionDsl, this@ColumnsSelectionDsl) - /** - * ## Deprecated: Columns by Index Range from List of Columns - * Helper function to create a [ColumnSet] from a list of columns by specifying a range of indices. - * - * ### Deprecated - * - * Deprecated because it's too niche. Let us know if you have a good use for it! - */ - @Deprecated( - message = COL_SELECT_DSL_LIST_DATACOLUMN_GET, - replaceWith = ReplaceWith(COL_SELECT_DSL_LIST_DATACOLUMN_GET_REPLACE), - level = DeprecationLevel.ERROR, - ) - public operator fun List>.get(range: IntRange): ColumnSet = - ColumnsList(subList(range.first, range.last + 1)) - // region select // NOTE: due to invoke conflicts these cannot be moved out of the interface 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 e4db42854f..8911eb96ae 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 @@ -45,20 +45,6 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve import org.jetbrains.kotlinx.dataframe.impl.columns.transform import org.jetbrains.kotlinx.dataframe.impl.owner -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_AFTER -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_BEFORE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_FROM -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_FROM_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_UP_TO -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_FROM -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_FROM_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_UP_TO -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_ALL_UP_TO_REPLACE import kotlin.reflect.KProperty // region DataColumn @@ -1187,126 +1173,6 @@ public interface AllColumnsSelectionDsl { public fun ColumnPath.allColsUpTo(column: KProperty<*>): ColumnSet<*> = columnGroup(this).allColsUpTo(column) // endregion - - // region deprecated - - @Deprecated( - COL_SELECT_DSL_ALL_COLS, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.all(): TransformableColumnSet<*> = allCols() - - @Deprecated( - COL_SELECT_DSL_ALL_COLS, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun String.all(): TransformableColumnSet<*> = allCols() - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_AFTER, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allAfter(column: ColumnPath): ColumnSet<*> = allColsAfter(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_AFTER, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allAfter(column: String): ColumnSet<*> = allColsAfter(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_AFTER, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allAfter(column: AnyColumnReference): ColumnSet<*> = allColsAfter(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_BEFORE, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allBefore(column: ColumnPath): ColumnSet<*> = allColsBefore(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_BEFORE, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allBefore(column: String): ColumnSet<*> = allColsBefore(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_BEFORE, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allBefore(column: AnyColumnReference): ColumnSet<*> = allColsBefore(column) - - @Deprecated(COL_SELECT_DSL_ALL_FROM, ReplaceWith(COL_SELECT_DSL_ALL_FROM_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allSince(column: ColumnPath): ColumnSet<*> = allFrom(column) - - @Deprecated(COL_SELECT_DSL_ALL_FROM, ReplaceWith(COL_SELECT_DSL_ALL_FROM_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allSince(column: String): ColumnSet<*> = allFrom(column) - - @Deprecated(COL_SELECT_DSL_ALL_FROM, ReplaceWith(COL_SELECT_DSL_ALL_FROM_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allSince(column: AnyColumnReference): ColumnSet<*> = allFrom(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_FROM, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allSince(column: ColumnPath): ColumnSet<*> = allColsFrom(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_FROM, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allSince(column: String): ColumnSet<*> = allColsFrom(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_FROM, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allSince(column: AnyColumnReference): ColumnSet<*> = allColsFrom(column) - - @Deprecated(COL_SELECT_DSL_ALL_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_UP_TO_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allUntil(column: ColumnPath): ColumnSet<*> = allUpTo(column) - - @Deprecated(COL_SELECT_DSL_ALL_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_UP_TO_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allUntil(column: String): ColumnSet<*> = allUpTo(column) - - @Deprecated(COL_SELECT_DSL_ALL_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_UP_TO_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.allUntil(column: AnyColumnReference): ColumnSet<*> = allUpTo(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_UP_TO, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allUntil(column: ColumnPath): ColumnSet<*> = allColsUpTo(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_UP_TO, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allUntil(column: String): ColumnSet<*> = allColsUpTo(column) - - @Deprecated( - COL_SELECT_DSL_ALL_COLS_UP_TO, - ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.allUntil(column: AnyColumnReference): ColumnSet<*> = allColsUpTo(column) - - // endregion } /** 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 f94bd27dd3..1031dc3848 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 @@ -24,15 +24,6 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle import org.jetbrains.kotlinx.dataframe.util.ALL_COLS_EXCEPT import org.jetbrains.kotlinx.dataframe.util.ALL_COLS_REPLACE import org.jetbrains.kotlinx.dataframe.util.ALL_COLS_REPLACE_VARARG -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_EXCEPT -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_EXCEPT_REPLACE_SELECTOR -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHER -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHERS -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVER -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVERS -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_SELECTOR import kotlin.reflect.KProperty // region ColumnsSelectionDsl @@ -1017,110 +1008,6 @@ public interface AllExceptColumnsSelectionDsl { columnGroup(this).exceptExperimentalInternal(others.toColumnSet()) // endregion - - // region deprecated - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_SELECTOR), - level = DeprecationLevel.ERROR, - ) - public infix fun SingleColumn>.except(selector: ColumnsSelector): ColumnSet<*> = - allColsExcept(selector) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVER), - level = DeprecationLevel.ERROR, - ) - public infix fun SingleColumn>.except(other: ColumnsResolver<*>): ColumnSet<*> = allColsExcept { other } - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVERS), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.except(vararg others: ColumnsResolver<*>): ColumnSet<*> = - allColsExcept { others.toColumnSet() } - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHER), - level = DeprecationLevel.ERROR, - ) - public infix fun SingleColumn>.except(other: String): ColumnSet<*> = allColsExcept(other) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHERS), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.except(vararg others: String): ColumnSet<*> = allColsExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHER), - level = DeprecationLevel.ERROR, - ) - public infix fun SingleColumn>.except(other: KProperty<*>): ColumnSet<*> = allColsExcept(other) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHERS), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.except(vararg others: KProperty<*>): ColumnSet<*> = allColsExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHER), - level = DeprecationLevel.ERROR, - ) - public infix fun SingleColumn>.except(other: ColumnPath): ColumnSet<*> = allColsExcept(other) - - @Deprecated( - message = COL_SELECT_DSL_SINGLE_COL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHERS), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.except(vararg others: ColumnPath): ColumnSet<*> = allColsExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_SELECTOR), - level = DeprecationLevel.ERROR, - ) - public fun ColumnsSelectionDsl.except(selector: ColumnsSelector): ColumnSet<*> = allExcept(selector) - - @Deprecated( - message = COL_SELECT_DSL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER), - level = DeprecationLevel.ERROR, - ) - public fun ColumnsSelectionDsl<*>.except(vararg others: ColumnsResolver<*>): ColumnSet<*> = allExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER), - level = DeprecationLevel.ERROR, - ) - public fun ColumnsSelectionDsl<*>.except(vararg others: String): ColumnSet<*> = allExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER), - level = DeprecationLevel.ERROR, - ) - public fun ColumnsSelectionDsl<*>.except(vararg others: KProperty<*>): ColumnSet<*> = allExcept(*others) - - @Deprecated( - message = COL_SELECT_DSL_EXCEPT, - replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER), - level = DeprecationLevel.ERROR, - ) - public fun ColumnsSelectionDsl<*>.except(vararg others: ColumnPath): ColumnSet<*> = allExcept(*others) - - // endregion } /** diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt index 35bde01f9a..9d09935703 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colGroups.kt @@ -19,8 +19,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSe import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet -import org.jetbrains.kotlinx.dataframe.util.COLS_SELECT_DSL_GROUP -import org.jetbrains.kotlinx.dataframe.util.COLS_SELECT_DSL_GROUP_REPLACE import kotlin.reflect.KProperty // region ColumnsSelectionDsl @@ -171,36 +169,6 @@ public interface ColGroupsColumnsSelectionDsl { */ public fun ColumnPath.colGroups(filter: Predicate> = { true }): TransformableColumnSet = columnGroup(this).colGroups(filter) - - // region deprecated - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun ColumnSet<*>.groups(filter: Predicate> = { true }): TransformableColumnSet = - columnGroupsInternal(filter) - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun SingleColumn>.groups( - filter: Predicate> = { true }, - ): TransformableColumnSet = this.ensureIsColumnGroup().columnGroupsInternal(filter) - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun ColumnsSelectionDsl<*>.groups( - filter: Predicate> = { true }, - ): TransformableColumnSet = this.asSingleColumn().columnGroupsInternal(filter) - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun String.groups(filter: Predicate> = { true }): TransformableColumnSet = - columnGroup(this).colGroups(filter) - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun KProperty<*>.groups(filter: Predicate> = { true }): TransformableColumnSet = - columnGroup(this).colGroups(filter) - - @Deprecated(COLS_SELECT_DSL_GROUP, ReplaceWith(COLS_SELECT_DSL_GROUP_REPLACE), DeprecationLevel.ERROR) - public fun ColumnPath.groups(filter: Predicate> = { true }): TransformableColumnSet = - columnGroup(this).colGroups(filter) - - // endregion } /** diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt index f977cb5e91..5aa97f5af1 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsAtAnyDepth.kt @@ -17,11 +17,7 @@ import org.jetbrains.kotlinx.dataframe.columns.SingleColumn import org.jetbrains.kotlinx.dataframe.documentation.DslGrammarTemplateColumnsSelectionDsl.DslGrammarTemplate import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak -import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet -import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableSingleColumn import org.jetbrains.kotlinx.dataframe.impl.columns.atAnyDepthImpl -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_AT_ANY_DEPTH -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE import kotlin.reflect.KProperty // region ColumnsSelectionDsl @@ -180,26 +176,6 @@ public interface ColsAtAnyDepthColumnsSelectionDsl { columnGroup(this).colsAtAnyDepth(predicate) // endregion - - // region deprecated recursively - - @Deprecated(COL_SELECT_DSL_AT_ANY_DEPTH, ReplaceWith(COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE), DeprecationLevel.ERROR) - public fun TransformableColumnSet.recursively(): ColumnSet = - atAnyDepthImpl(includeTopLevel = true, includeGroups = true) - - @Deprecated(COL_SELECT_DSL_AT_ANY_DEPTH, ReplaceWith(COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE), DeprecationLevel.ERROR) - public fun TransformableColumnSet.rec(): ColumnSet = - atAnyDepthImpl(includeTopLevel = true, includeGroups = true) - - @Deprecated(COL_SELECT_DSL_AT_ANY_DEPTH, ReplaceWith(COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE), DeprecationLevel.ERROR) - public fun TransformableSingleColumn<*>.recursively(): SingleColumn<*> = - atAnyDepthImpl(includeTopLevel = true, includeGroups = true) - - @Deprecated(COL_SELECT_DSL_AT_ANY_DEPTH, ReplaceWith(COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE), DeprecationLevel.ERROR) - public fun TransformableSingleColumn<*>.rec(): SingleColumn<*> = - atAnyDepthImpl(includeTopLevel = true, includeGroups = true) - - // endregion } /** diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt index 9214c4e332..b129a4ed1e 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/colsInGroups.kt @@ -17,10 +17,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.TransformableColumnSet import org.jetbrains.kotlinx.dataframe.impl.columns.transform -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_CHILDREN -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_CHILDREN_REPLACE -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_CHILDREN_SINGLE_COL -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE import kotlin.reflect.KProperty // region ColumnsSelectionDsl @@ -176,46 +172,6 @@ public interface ColsInGroupsColumnsSelectionDsl { */ public fun ColumnPath.colsInGroups(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = columnGroup(this).colsInGroups(predicate) - - // region deprecated - - @Deprecated(COL_SELECT_DSL_CHILDREN, ReplaceWith(COL_SELECT_DSL_CHILDREN_REPLACE), level = DeprecationLevel.ERROR) - public fun ColumnSet<*>.children(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = - colsInGroups(predicate) - - @Deprecated( - COL_SELECT_DSL_CHILDREN_SINGLE_COL, - ReplaceWith(COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.children(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = - ensureIsColumnGroup().colsInternal(predicate) - - @Deprecated( - COL_SELECT_DSL_CHILDREN_SINGLE_COL, - ReplaceWith(COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun String.children(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = - columnGroup(this).ensureIsColumnGroup().colsInternal(predicate) - - @Deprecated( - COL_SELECT_DSL_CHILDREN_SINGLE_COL, - ReplaceWith(COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun KProperty>.children(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = - columnGroup(this).ensureIsColumnGroup().colsInternal(predicate) - - @Deprecated( - COL_SELECT_DSL_CHILDREN_SINGLE_COL, - ReplaceWith(COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun ColumnPath.children(predicate: ColumnFilter<*> = { true }): TransformableColumnSet<*> = - columnGroup(this).ensureIsColumnGroup().colsInternal(predicate) - - // endregion } // endregion 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 75f35f363e..97ddc798cb 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 @@ -24,8 +24,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.documentation.SelectingColumns import org.jetbrains.kotlinx.dataframe.impl.columns.changePath import org.jetbrains.kotlinx.dataframe.impl.columns.createColumnSet -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SELECT_COLS -import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_SELECT_COLS_REPLACE import kotlin.reflect.KProperty // region DataFrame @@ -215,34 +213,6 @@ public interface SelectColumnsSelectionDsl { * `df.`[select][DataFrame.select]` { `[pathOf][pathOf]`("pathTo", "myColGroup")`[`() {`][ColumnPath.select]` someCol `[and][ColumnsSelectionDsl.and]` `[colsOf][SingleColumn.colsOf]`<`[String][String]`>() `[`}`][ColumnPath.select]` }` */ public fun ColumnPath.select(selector: ColumnsSelector<*, R>): ColumnSet = columnGroup(this).select(selector) - - // region deprecated - - @Deprecated( - message = COL_SELECT_DSL_SELECT_COLS, - replaceWith = ReplaceWith(COL_SELECT_DSL_SELECT_COLS_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.select(vararg columns: String): ColumnSet<*> = - selectInternal { columns.toColumnSet() } - - @Deprecated( - message = COL_SELECT_DSL_SELECT_COLS, - replaceWith = ReplaceWith(COL_SELECT_DSL_SELECT_COLS_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.select(vararg columns: ColumnReference): ColumnSet = - selectInternal { columns.toColumnSet() } - - @Deprecated( - message = COL_SELECT_DSL_SELECT_COLS, - replaceWith = ReplaceWith(COL_SELECT_DSL_SELECT_COLS_REPLACE), - level = DeprecationLevel.ERROR, - ) - public fun SingleColumn>.select(vararg columns: KProperty): ColumnSet = - selectInternal { columns.toColumnSet() } - - // endregion } internal fun SingleColumn>.selectInternal(selector: ColumnsSelector): ColumnSet = diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt index b8bf1ce408..770b2c267c 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/simplify.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlinx.dataframe.documentation.Indent import org.jetbrains.kotlinx.dataframe.documentation.LineBreak import org.jetbrains.kotlinx.dataframe.impl.columns.simplify import org.jetbrains.kotlinx.dataframe.impl.columns.transform -import org.jetbrains.kotlinx.dataframe.util.TOP_MESSAGE // region ColumnsSelectionDsl @@ -64,13 +63,6 @@ public interface SimplifyColumnsSelectionDsl { */ @Suppress("UNCHECKED_CAST") public fun ColumnSet.simplify(): ColumnSet = simplifyInternal() as ColumnSet - - // region deprecated - - @Deprecated(TOP_MESSAGE, ReplaceWith("simplify()"), DeprecationLevel.ERROR) - public fun ColumnSet.roots(): ColumnSet = simplify() - - // endregion } /** diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnWithPath.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnWithPath.kt index 56f6bfa2a6..1ed1c1a6ea 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnWithPath.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/columns/ColumnWithPath.kt @@ -6,7 +6,6 @@ import org.jetbrains.kotlinx.dataframe.api.isColumnGroup import org.jetbrains.kotlinx.dataframe.impl.columns.addParentPath import org.jetbrains.kotlinx.dataframe.impl.columns.addPath import org.jetbrains.kotlinx.dataframe.impl.columns.depth -import org.jetbrains.kotlinx.dataframe.util.COLUMN_WITH_PATH_MESSAGE import kotlin.reflect.KProperty public interface ColumnWithPath : DataColumn { @@ -59,45 +58,6 @@ public interface ColumnWithPath : DataColumn { override fun path(): ColumnPath = path override fun rename(newName: String): ColumnWithPath - - // region deprecated - - @Deprecated( - message = COLUMN_WITH_PATH_MESSAGE, - replaceWith = ReplaceWith("getCol(accessor)"), - level = DeprecationLevel.ERROR, - ) - public fun getChild(accessor: ColumnReference): ColumnWithPath? = getCol(accessor) - - @Deprecated( - message = COLUMN_WITH_PATH_MESSAGE, - replaceWith = ReplaceWith("getCol(name)"), - level = DeprecationLevel.ERROR, - ) - public fun getChild(name: String): ColumnWithPath? = getCol(name) - - @Deprecated( - message = COLUMN_WITH_PATH_MESSAGE, - replaceWith = ReplaceWith("getCol(index)"), - level = DeprecationLevel.ERROR, - ) - public fun getChild(index: Int): ColumnWithPath? = getCol(index) - - @Deprecated( - message = COLUMN_WITH_PATH_MESSAGE, - replaceWith = ReplaceWith("getCol(accessor)"), - level = DeprecationLevel.ERROR, - ) - public fun getChild(accessor: KProperty): ColumnWithPath? = getCol(accessor) - - @Deprecated( - message = COLUMN_WITH_PATH_MESSAGE, - replaceWith = ReplaceWith("cols()"), - level = DeprecationLevel.ERROR, - ) - public fun children(): List> = cols() - - // endregion } public val ColumnWithPath.depth: Int get() = path.depth() diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt index 991d0e497f..79a96910d7 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt @@ -7,71 +7,6 @@ package org.jetbrains.kotlinx.dataframe.util * Level.ERROR -> Remove */ -// region WARNING in 0.13, ERROR in 0.14 - -private const val MESSAGE_0_14 = "Will be removed in 0.14." - -internal const val COLUMN_WITH_PATH_MESSAGE = "`child` references are replaced with `col`. $MESSAGE_0_14" - -internal const val COLS_SELECT_DSL_GROUP = "Use `colGroups` instead. $MESSAGE_0_14" -internal const val COLS_SELECT_DSL_GROUP_REPLACE = "this.colGroups(filter)" - -internal const val COL_SELECT_DSL_ALL_COLS = "Use `allCols()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_COLS_REPLACE = "this.allCols()" - -internal const val COL_SELECT_DSL_ALL_COLS_AFTER = "Use `allColsAfter()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE = "this.allColsAfter(column)" - -internal const val COL_SELECT_DSL_ALL_COLS_BEFORE = "Use `allColsBefore()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE = "this.allColsBefore(column)" - -internal const val COL_SELECT_DSL_ALL_FROM = "Use `allFrom()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_FROM_REPLACE = "this.allFrom(column)" - -internal const val COL_SELECT_DSL_ALL_COLS_FROM = "Use `allColsFrom()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_COLS_FROM_REPLACE = "this.allColsFrom(column)" - -internal const val COL_SELECT_DSL_ALL_UP_TO = "Use `allUpTo()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_UP_TO_REPLACE = "this.allUpTo(column)" - -internal const val COL_SELECT_DSL_ALL_COLS_UP_TO = "Use `allColsUpTo()` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE = "this.allColsUpTo(column)" - -internal const val COL_SELECT_DSL_AT_ANY_DEPTH = - "This postfix notation is now deprecated. Use `colsAtAnyDepth().YOUR_OPERATION` instead (NOTE: ReplaceWith is incorrect). $MESSAGE_0_14" - -// TODO https://youtrack.jetbrains.com/issue/KTIJ-27052/ReplaceWith-Deprecated-this-after-call-bug -internal const val COL_SELECT_DSL_AT_ANY_DEPTH_REPLACE = "this" - -internal const val COL_SELECT_DSL_CHILDREN = "Use colsInGroups {} instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_CHILDREN_REPLACE = "this.colsInGroups(predicate)" - -internal const val COL_SELECT_DSL_CHILDREN_SINGLE_COL = "Use cols {} instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_CHILDREN_SINGLE_COL_REPLACE = "this.cols(predicate)" - -internal const val TOP_MESSAGE = "top is deprecated, use simplify() instead. $MESSAGE_0_14" - -internal const val COL_SELECT_DSL_LIST_DATACOLUMN_GET = - "This function is deprecated. Use `.toColumnSet()[]` instead. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_LIST_DATACOLUMN_GET_REPLACE = "this.toColumnSet()[range]" - -internal const val COL_SELECT_DSL_SELECT_COLS = - "Nested select is reserved for ColumnsSelector/ColumnsSelectionDsl behavior. Use myGroup.cols() to select columns by name from a ColumnGroup. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_SELECT_COLS_REPLACE = "this.cols(*columns)" - -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT = "This function is replaced with allColsExcept. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_SELECTOR = "this.allColsExcept(selector)" -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVERS = "this.allColsExcept { others.toColumnSet() }" -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVER = "this.allColsExcept { other }" -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHERS = "this.allColsExcept(*others)" -internal const val COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_OTHER = "this.allColsExcept(other)" - -internal const val COL_SELECT_DSL_EXCEPT = "This function is replaced with allExcept. $MESSAGE_0_14" -internal const val COL_SELECT_DSL_EXCEPT_REPLACE_SELECTOR = "this.allExcept(selector)" -internal const val COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER = "this.allExcept(*others)" - -// endregion - // region WARNING in 0.14, ERROR in 0.15 private const val MESSAGE_0_15 = "Will be removed in 0.15." @@ -84,6 +19,12 @@ private const val MESSAGE_0_16 = "Will be removed in 0.16." // endregion +// region WARNING in 0.16, ERROR in 0.17 + +private const val MESSAGE_0_17 = "Will be removed in 0.17." + +// endregion + // region keep across releases internal const val IDENTITY_FUNCTION = "This overload is an identity function and can be omitted."