Skip to content

Commit

Permalink
Merge pull request #636 from Kotlin/version-bump-to-0.14.0
Browse files Browse the repository at this point in the history
Dev version bump to 0.14.0 & updating deprecations
  • Loading branch information
Jolanrensen authored Mar 25, 2024
2 parents 4efe154 + 25200a7 commit 9adfcee
Show file tree
Hide file tree
Showing 41 changed files with 331 additions and 863 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public interface ColumnsSelectionDsl<out T> : /* SingleColumn<DataRow<T>> */
@Deprecated(
message = COL_SELECT_DSL_LIST_DATACOLUMN_GET,
replaceWith = ReplaceWith(COL_SELECT_DSL_LIST_DATACOLUMN_GET_REPLACE),
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public operator fun <C> List<DataColumn<C>>.get(range: IntRange): ColumnSet<C> =
ColumnsList(subList(range.first, range.last + 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import org.jetbrains.kotlinx.dataframe.index
import org.jetbrains.kotlinx.dataframe.indices
import org.jetbrains.kotlinx.dataframe.ncol
import org.jetbrains.kotlinx.dataframe.nrow
import org.jetbrains.kotlinx.dataframe.util.DIFF_DEPRECATION_MESSAGE
import org.jetbrains.kotlinx.dataframe.util.DIFF_OR_NULL_IMPORT
import org.jetbrains.kotlinx.dataframe.util.DIFF_REPLACE_MESSAGE
import kotlin.experimental.ExperimentalTypeInference
import kotlin.reflect.KProperty
import kotlin.reflect.KType
Expand Down Expand Up @@ -162,40 +159,6 @@ public fun <T> DataRow<T>.diffOrNull(expression: RowExpression<T, Long>): Long?
public fun <T> DataRow<T>.diffOrNull(expression: RowExpression<T, Float>): Float? =
prev()?.let { p -> expression(this, this) - expression(p, p) }

@OptIn(ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@Deprecated(
DIFF_DEPRECATION_MESSAGE,
ReplaceWith(DIFF_REPLACE_MESSAGE, DIFF_OR_NULL_IMPORT),
DeprecationLevel.ERROR,
)
public fun <T> DataRow<T>.diff(expression: RowExpression<T, Double>): Double? =
prev()?.let { p -> expression(this, this) - expression(p, p) }

@Deprecated(
DIFF_DEPRECATION_MESSAGE,
ReplaceWith(DIFF_REPLACE_MESSAGE, DIFF_OR_NULL_IMPORT),
DeprecationLevel.ERROR,
)
public fun <T> DataRow<T>.diff(expression: RowExpression<T, Int>): Int? =
prev()?.let { p -> expression(this, this) - expression(p, p) }

@Deprecated(
DIFF_DEPRECATION_MESSAGE,
ReplaceWith(DIFF_REPLACE_MESSAGE, DIFF_OR_NULL_IMPORT),
DeprecationLevel.ERROR,
)
public fun <T> DataRow<T>.diff(expression: RowExpression<T, Long>): Long? =
prev()?.let { p -> expression(this, this) - expression(p, p) }

@Deprecated(
DIFF_DEPRECATION_MESSAGE,
ReplaceWith(DIFF_REPLACE_MESSAGE, DIFF_OR_NULL_IMPORT),
DeprecationLevel.ERROR,
)
public fun <T> DataRow<T>.diff(expression: RowExpression<T, Float>): Float? =
prev()?.let { p -> expression(this, this) - expression(p, p) }

public fun AnyRow.columnsCount(): Int = df().ncol

public fun AnyRow.columnNames(): List<String> = df().columnNames()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10128,64 +10128,120 @@ public interface AllColumnsSelectionDsl {

// region deprecated

@Deprecated(COL_SELECT_DSL_ALL_COLS, ReplaceWith(COL_SELECT_DSL_ALL_COLS_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.all(): TransformableColumnSet<*> = allCols()

@Deprecated(COL_SELECT_DSL_ALL_COLS, ReplaceWith(COL_SELECT_DSL_ALL_COLS_REPLACE))
@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))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_AFTER,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allAfter(column: ColumnPath): ColumnSet<*> = allColsAfter(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_AFTER, ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_AFTER,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allAfter(column: String): ColumnSet<*> = allColsAfter(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_AFTER, ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_AFTER,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_AFTER_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allAfter(column: AnyColumnReference): ColumnSet<*> = allColsAfter(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_BEFORE, ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_BEFORE,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allBefore(column: ColumnPath): ColumnSet<*> = allColsBefore(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_BEFORE, ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_BEFORE,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allBefore(column: String): ColumnSet<*> = allColsBefore(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_BEFORE, ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_BEFORE,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_BEFORE_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allBefore(column: AnyColumnReference): ColumnSet<*> = allColsBefore(column)

@Deprecated(COL_SELECT_DSL_ALL_FROM, ReplaceWith(COL_SELECT_DSL_ALL_FROM_REPLACE))
@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))
@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))
@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))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_FROM,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allSince(column: ColumnPath): ColumnSet<*> = allColsFrom(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_FROM, ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_FROM,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allSince(column: String): ColumnSet<*> = allColsFrom(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_FROM, ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_FROM,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_FROM_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allSince(column: AnyColumnReference): ColumnSet<*> = allColsFrom(column)

@Deprecated(COL_SELECT_DSL_ALL_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_UP_TO_REPLACE))
@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))
@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))
@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))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_UP_TO,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allUntil(column: ColumnPath): ColumnSet<*> = allColsUpTo(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_UP_TO,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allUntil(column: String): ColumnSet<*> = allColsUpTo(column)

@Deprecated(COL_SELECT_DSL_ALL_COLS_UP_TO, ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE))
@Deprecated(
COL_SELECT_DSL_ALL_COLS_UP_TO,
ReplaceWith(COL_SELECT_DSL_ALL_COLS_UP_TO_REPLACE),
level = DeprecationLevel.ERROR
)
public fun SingleColumn<DataRow<*>>.allUntil(column: AnyColumnReference): ColumnSet<*> = allColsUpTo(column)

// endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4668,111 +4668,111 @@ public interface AllExceptColumnsSelectionDsl {
@Deprecated(
message = COL_SELECT_DSL_SINGLE_COL_EXCEPT,
replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_SELECTOR),
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public infix fun <C> SingleColumn<DataRow<C>>.except(selector: ColumnsSelector<C, *>): ColumnSet<*> =
allColsExcept(selector)

@Deprecated(
message = COL_SELECT_DSL_SINGLE_COL_EXCEPT,
replaceWith = ReplaceWith(COL_SELECT_DSL_SINGLE_COL_EXCEPT_REPLACE_RESOLVER),
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public infix fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public infix fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public infix fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public infix fun SingleColumn<DataRow<*>>.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.WARNING,
level = DeprecationLevel.ERROR,
)
public fun SingleColumn<DataRow<*>>.except(vararg others: ColumnPath): ColumnSet<*> =
allColsExcept(*others)

@Deprecated(
message = COL_SELECT_DSL_EXCEPT,
replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_SELECTOR),
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public fun <C> ColumnsSelectionDsl<C>.except(selector: ColumnsSelector<C, *>): ColumnSet<*> =
allExcept(selector)

@Deprecated(
message = COL_SELECT_DSL_EXCEPT,
replaceWith = ReplaceWith(COL_SELECT_DSL_EXCEPT_REPLACE_RESOLVER),
level = DeprecationLevel.WARNING,
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.WARNING,
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.WARNING,
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.WARNING,
level = DeprecationLevel.ERROR,
)
public fun ColumnsSelectionDsl<*>.except(vararg others: ColumnPath): ColumnSet<*> =
allExcept(*others)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package org.jetbrains.kotlinx.dataframe.api

import org.jetbrains.kotlinx.dataframe.AnyColumnGroupAccessor
import org.jetbrains.kotlinx.dataframe.ColumnGroupReference
import org.jetbrains.kotlinx.dataframe.ColumnsContainer
import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.DataRow
import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar
import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.ColumnGroupName
import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.ColumnSetName
import org.jetbrains.kotlinx.dataframe.api.ColGroupColumnsSelectionDsl.Grammar.PlainDslName
Expand All @@ -22,8 +22,6 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.getAt
import org.jetbrains.kotlinx.dataframe.impl.columns.onResolve
import org.jetbrains.kotlinx.dataframe.impl.columns.singleImpl
import org.jetbrains.kotlinx.dataframe.impl.columns.transformSingle
import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_GROUP
import org.jetbrains.kotlinx.dataframe.util.COL_SELECT_DSL_GROUP_REPLACE
import kotlin.reflect.KProperty

// region ColumnsSelectionDsl
Expand Down Expand Up @@ -3475,17 +3473,6 @@ public interface ColGroupColumnsSelectionDsl {
columnGroup(this).colGroup<C>(index)

// endregion

// region deprecated

@Deprecated(
message = COL_SELECT_DSL_GROUP,
replaceWith = ReplaceWith(COL_SELECT_DSL_GROUP_REPLACE),
level = DeprecationLevel.ERROR,
)
public fun ColumnsContainer<*>.group(name: String): ColumnGroupReference = name.toColumnOf()

// endregion
}

/**
Expand Down
Loading

0 comments on commit 9adfcee

Please sign in to comment.