Skip to content

Deprecation messages #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions RELEASE_CHECK_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@
17. Create Release from the release tag on GitHub
18. Update a KDF version in the [Kotlin Jupyter Descriptor](https://github.com/Kotlin/kotlin-jupyter-libraries/blob/master/dataframe.json). Now the Renovate bot doing this
19. Update DataFrame version in gradle.properties file for next release cycle (i.e. 0.10.0 -> 0.11.0)
20. Update deprecated functions in [deprecationMessages.kt](/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt)
such that
- `Level.WARNING` messages are changed to `Level.ERROR`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, love this!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a post-release section with 19 paragraph

- `Level.ERROR` messages and their functions are removed.
- Update regions in the file accordingly.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import org.jetbrains.kotlinx.dataframe.impl.api.updateImpl
import org.jetbrains.kotlinx.dataframe.impl.api.updateWithValuePerColumnImpl
import org.jetbrains.kotlinx.dataframe.impl.headPlusArray
import org.jetbrains.kotlinx.dataframe.util.ITERABLE_COLUMNS_DEPRECATION_MESSAGE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_AS_NULLABLE_MESSAGE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_AS_NULLABLE_REPLACE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_WITH_VALUE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_WITH_VALUE_REPLACE
import kotlin.reflect.KProperty

/**
Expand Down Expand Up @@ -403,8 +407,9 @@ public fun <T, C, R> Update<T, DataRow<C>>.asFrame(expression: DataFrameExpressi
asFrameImpl(expression)

@Deprecated(
"Useless unless in combination with `withValue(null)`, but then users can just use `with { null }`...",
ReplaceWith("this as Update<T, C?>")
UPDATE_AS_NULLABLE_MESSAGE,
ReplaceWith(UPDATE_AS_NULLABLE_REPLACE),
DeprecationLevel.WARNING,
)
public fun <T, C> Update<T, C>.asNullable(): Update<T, C?> = this as Update<T, C?>

Expand Down Expand Up @@ -752,7 +757,7 @@ public fun <T, C> Update<T, C>.withNull(): DataFrame<T> = with { null }
public fun <T, C> Update<T, C>.withZero(): DataFrame<T> = updateWithValuePerColumnImpl { 0 as C }

/**
* ## With Value
* ## With Value (Deprecated)
* Specific version of [with][org.jetbrains.kotlinx.dataframe.api.with] that simply sets the value of each selected row to [value].
*
* For example:
Expand All @@ -763,5 +768,5 @@ public fun <T, C> Update<T, C>.withZero(): DataFrame<T> = updateWithValuePerColu
*
* @param [value] The value to set the selected rows to. In contrast to [with][Update.with], this must be the same exact type.
*/
@Deprecated("Use with { value } instead", ReplaceWith("this.with { value }"))
@Deprecated(UPDATE_WITH_VALUE, ReplaceWith(UPDATE_WITH_VALUE_REPLACE), DeprecationLevel.WARNING)
public fun <T, C> Update<T, C>.withValue(value: C): DataFrame<T> = with { value }
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
package org.jetbrains.kotlinx.dataframe.util

internal const val DF_READ_DEPRECATION_MESSAGE = "Replaced with `unfold` operation."
/*
* This file contains deprecation messages for the whole core module.
* After each release, all messages should be reviewed and updated.
* Level.WARNING -> Level.ERROR
* Level.ERROR -> Remove
*/

// region WARNING in 0.10.0, ERROR in 0.11.0

private const val message_0_11_0 = "Was removed in 0.11.0."

internal const val DF_READ_DEPRECATION_MESSAGE = "Replaced with `unfold` operation. $message_0_11_0"
internal const val DF_READ_REPLACE_MESSAGE = "this.unfold(*columns)"

internal const val ITERABLE_COLUMNS_DEPRECATION_MESSAGE = "Replaced with `toColumnSet()` operation."
internal const val ITERABLE_COLUMNS_DEPRECATION_MESSAGE = "Replaced with `toColumnSet()` operation. $message_0_11_0"

internal const val DIFF_DEPRECATION_MESSAGE = "Replaced to explicitly indicate nullable return value; added a new non-null overload."
// endregion

internal const val DIFF_REPLACE_MESSAGE = "this.diffOrNull(expression)"
// region WARNING in 0.11.0, ERROR in 0.12.0

private const val message_0_12_0 = "Will be removed in 0.12.0."

internal const val DIFF_DEPRECATION_MESSAGE = "Replaced to explicitly indicate nullable return value; added a new non-null overload. $message_0_12_0"
internal const val DIFF_REPLACE_MESSAGE = "this.diffOrNull(expression)"
internal const val DIFF_OR_NULL_IMPORT = "org.jetbrains.kotlinx.dataframe.api.diffOrNull"

internal const val UPDATE_AS_NULLABLE_MESSAGE = "This function is useless unless in combination with `withValue(null)`, but then you can just use `with { null }`. $message_0_12_0"
internal const val UPDATE_AS_NULLABLE_REPLACE = "this as Update<T, C?>"

internal const val UPDATE_WITH_VALUE = "Replaced in favor of `with { value }`. $message_0_12_0"
internal const val UPDATE_WITH_VALUE_REPLACE = "this.with { value }"

// endregion

// region WARNING in 0.12.0, ERROR in 0.13.0

private const val message_0_13_0 = "Will be removed in 0.13.0."

// endregion
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import org.jetbrains.kotlinx.dataframe.impl.api.updateImpl
import org.jetbrains.kotlinx.dataframe.impl.api.updateWithValuePerColumnImpl
import org.jetbrains.kotlinx.dataframe.impl.headPlusArray
import org.jetbrains.kotlinx.dataframe.util.ITERABLE_COLUMNS_DEPRECATION_MESSAGE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_AS_NULLABLE_MESSAGE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_AS_NULLABLE_REPLACE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_WITH_VALUE
import org.jetbrains.kotlinx.dataframe.util.UPDATE_WITH_VALUE_REPLACE
import kotlin.reflect.KProperty

/**
Expand Down Expand Up @@ -247,8 +251,9 @@ public fun <T, C, R> Update<T, DataRow<C>>.asFrame(expression: DataFrameExpressi
asFrameImpl(expression)

@Deprecated(
"Useless unless in combination with `withValue(null)`, but then users can just use `with { null }`...",
ReplaceWith("this as Update<T, C?>")
UPDATE_AS_NULLABLE_MESSAGE,
ReplaceWith(UPDATE_AS_NULLABLE_REPLACE),
DeprecationLevel.WARNING,
)
public fun <T, C> Update<T, C>.asNullable(): Update<T, C?> = this as Update<T, C?>

Expand Down Expand Up @@ -445,12 +450,12 @@ public fun <T, C> Update<T, C>.withNull(): DataFrame<T> = with { null }
public fun <T, C> Update<T, C>.withZero(): DataFrame<T> = updateWithValuePerColumnImpl { 0 as C }

/**
* ## With Value
* ## With Value (Deprecated)
* @include [CommonSpecificWithDoc]
* {@arg [CommonSpecificWithDocFirstArg] [value]}
* {@arg [CommonSpecificWithDocSecondArg] [withValue][withValue]`(-1)}
*
* @param [value] The value to set the selected rows to. In contrast to [with][Update.with], this must be the same exact type.
*/
@Deprecated("Use with { value } instead", ReplaceWith("this.with { value }"))
@Deprecated(UPDATE_WITH_VALUE, ReplaceWith(UPDATE_WITH_VALUE_REPLACE), DeprecationLevel.WARNING)
public fun <T, C> Update<T, C>.withValue(value: C): DataFrame<T> = with { value }
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
package org.jetbrains.kotlinx.dataframe.util

internal const val DF_READ_DEPRECATION_MESSAGE = "Replaced with `unfold` operation."
/*
* This file contains deprecation messages for the whole core module.
* After each release, all messages should be reviewed and updated.
* Level.WARNING -> Level.ERROR
* Level.ERROR -> Remove
*/

// region WARNING in 0.10.0, ERROR in 0.11.0

private const val message_0_11_0 = "Was removed in 0.11.0."

internal const val DF_READ_DEPRECATION_MESSAGE = "Replaced with `unfold` operation. $message_0_11_0"
internal const val DF_READ_REPLACE_MESSAGE = "this.unfold(*columns)"

internal const val ITERABLE_COLUMNS_DEPRECATION_MESSAGE = "Replaced with `toColumnSet()` operation."
internal const val ITERABLE_COLUMNS_DEPRECATION_MESSAGE = "Replaced with `toColumnSet()` operation. $message_0_11_0"

internal const val DIFF_DEPRECATION_MESSAGE = "Replaced to explicitly indicate nullable return value; added a new non-null overload."
// endregion

internal const val DIFF_REPLACE_MESSAGE = "this.diffOrNull(expression)"
// region WARNING in 0.11.0, ERROR in 0.12.0

private const val message_0_12_0 = "Will be removed in 0.12.0."

internal const val DIFF_DEPRECATION_MESSAGE = "Replaced to explicitly indicate nullable return value; added a new non-null overload. $message_0_12_0"
internal const val DIFF_REPLACE_MESSAGE = "this.diffOrNull(expression)"
internal const val DIFF_OR_NULL_IMPORT = "org.jetbrains.kotlinx.dataframe.api.diffOrNull"

internal const val UPDATE_AS_NULLABLE_MESSAGE = "This function is useless unless in combination with `withValue(null)`, but then you can just use `with { null }`. $message_0_12_0"
internal const val UPDATE_AS_NULLABLE_REPLACE = "this as Update<T, C?>"

internal const val UPDATE_WITH_VALUE = "Replaced in favor of `with { value }`. $message_0_12_0"
internal const val UPDATE_WITH_VALUE_REPLACE = "this.with { value }"

// endregion

// region WARNING in 0.12.0, ERROR in 0.13.0

private const val message_0_13_0 = "Will be removed in 0.13.0."

// endregion