Skip to content

Commit e8cb692

Browse files
Automated commit of generated code
1 parent 6b74884 commit e8cb692

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import org.jetbrains.kotlinx.dataframe.exceptions.DuplicateColumnNamesException
2424
import org.jetbrains.kotlinx.dataframe.exceptions.UnequalColumnSizesException
2525
import org.jetbrains.kotlinx.dataframe.impl.api.insertImpl
2626
import org.jetbrains.kotlinx.dataframe.impl.columns.resolveSingle
27+
import org.jetbrains.kotlinx.dataframe.util.ADD_VARARG_COLUMNS
28+
import org.jetbrains.kotlinx.dataframe.util.ADD_VARARG_COLUMNS_REPLACE
29+
import org.jetbrains.kotlinx.dataframe.util.ADD_VARARG_FRAMES
30+
import org.jetbrains.kotlinx.dataframe.util.ADD_VARARG_FRAMES_REPLACE
2731
import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
2832
import kotlin.reflect.KProperty
2933

@@ -41,8 +45,27 @@ import kotlin.reflect.KProperty
4145
* @throws [UnequalColumnSizesException] if columns in an expected result have different sizes.
4246
* @return new [DataFrame] with added columns.
4347
*/
48+
@Deprecated(
49+
message = ADD_VARARG_COLUMNS,
50+
replaceWith = ReplaceWith(ADD_VARARG_COLUMNS_REPLACE),
51+
level = DeprecationLevel.WARNING,
52+
)
4453
public fun <T> DataFrame<T>.add(vararg columns: AnyBaseCol): DataFrame<T> = addAll(columns.asIterable())
4554

55+
/**
56+
* Adds new [columns] to the end of this [DataFrame] (at the top level).
57+
*
58+
* Returns a new [DataFrame] with the new [columns] appended to the original list of [DataFrame.columns].
59+
*
60+
* For more information: [See `add` on the documentation website.](https://kotlin.github.io/dataframe/add.html).
61+
*
62+
* @param columns columns to add.
63+
* @throws [DuplicateColumnNamesException] if columns in an expected result have repeated names.
64+
* @throws [UnequalColumnSizesException] if columns in an expected result have different sizes.
65+
* @return new [DataFrame] with added columns.
66+
*/
67+
public fun <T> DataFrame<T>.addAll(vararg columns: AnyBaseCol): DataFrame<T> = addAll(columns.asIterable())
68+
4669
/**
4770
* Adds new [columns] to the end of this [DataFrame] (at the top level).
4871
*
@@ -71,8 +94,28 @@ public fun <T> DataFrame<T>.addAll(columns: Iterable<AnyBaseCol>): DataFrame<T>
7194
* @throws [UnequalColumnSizesException] if columns in an expected result have different sizes.
7295
* @return new [DataFrame] with added columns.
7396
*/
97+
@Deprecated(
98+
message = ADD_VARARG_FRAMES,
99+
replaceWith = ReplaceWith(ADD_VARARG_FRAMES_REPLACE),
100+
level = DeprecationLevel.WARNING,
101+
)
74102
public fun <T> DataFrame<T>.add(vararg dataFrames: AnyFrame): DataFrame<T> = addAll(dataFrames.asIterable())
75103

104+
/**
105+
* Adds all columns from the given [dataFrames] to the end of this [DataFrame] (at the top level).
106+
*
107+
* Returns a new [DataFrame] with the columns from the specified
108+
* [dataFrames] appended to the original list of [DataFrame.columns].
109+
*
110+
* For more information: [See `add` on the documentation website.](https://kotlin.github.io/dataframe/add.html).
111+
*
112+
* @param dataFrames dataFrames to get columns from.
113+
* @throws [DuplicateColumnNamesException] if columns in an expected result have repeated names.
114+
* @throws [UnequalColumnSizesException] if columns in an expected result have different sizes.
115+
* @return new [DataFrame] with added columns.
116+
*/
117+
public fun <T> DataFrame<T>.addAll(vararg dataFrames: AnyFrame): DataFrame<T> = addAll(dataFrames.asIterable())
118+
76119
/**
77120
* Adds all columns from the given [dataFrames] to the end of this [DataFrame] (at the top level).
78121
*

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ internal const val LENGTH_REPLACE = "this.map { it?.length ?: 0 }"
239239
internal const val LOWERCASE_REPLACE = "this.map { it?.lowercase() }"
240240
internal const val UPPERCASE_REPLACE = "this.map { it?.uppercase() }"
241241

242+
internal const val ADD_VARARG_COLUMNS = "Deprecated in favor of `addAll(vararg)` to improve completion. $MESSAGE_1_1"
243+
internal const val ADD_VARARG_COLUMNS_REPLACE = "this.addAll(*columns)"
244+
245+
internal const val ADD_VARARG_FRAMES = "Deprecated in favor of `addAll(vararg)` to improve completion. $MESSAGE_1_1"
246+
internal const val ADD_VARARG_FRAMES_REPLACE = "this.addAll(*dataFrames)"
247+
242248
// endregion
243249

244250
// region keep across releases

0 commit comments

Comments
 (0)