@@ -24,6 +24,10 @@ import org.jetbrains.kotlinx.dataframe.exceptions.DuplicateColumnNamesException
2424import org.jetbrains.kotlinx.dataframe.exceptions.UnequalColumnSizesException
2525import org.jetbrains.kotlinx.dataframe.impl.api.insertImpl
2626import 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
2731import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
2832import 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+ )
4453public 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+ )
74102public 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 *
0 commit comments