Skip to content

Commit 0ef1b37

Browse files
Automated commit of generated code
1 parent d788bdd commit 0ef1b37

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.jetbrains.kotlinx.dataframe.DataColumn
55
import org.jetbrains.kotlinx.dataframe.DataFrame
66
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
77
import org.jetbrains.kotlinx.dataframe.documentation.ColumnExpression
8+
import kotlin.reflect.typeOf
89

910
// region ColumnsSelectionDsl
1011

@@ -93,6 +94,6 @@ public inline fun <T, reified R> ColumnsSelectionDsl<T>.expr(
9394
name: String = "",
9495
infer: Infer = Infer.Nulls,
9596
noinline expression: AddExpression<T, R>,
96-
): DataColumn<R> = mapToColumn(name, infer, expression)
97+
): DataColumn<R> = mapToColumn(name, typeOf<R>(), infer, expression)
9798

9899
// endregion

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.impl.columnName
1616
import org.jetbrains.kotlinx.dataframe.impl.columns.createComputedColumnReference
1717
import org.jetbrains.kotlinx.dataframe.impl.columns.newColumn
1818
import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
19+
import org.jetbrains.kotlinx.dataframe.util.UNIFIED_SIMILAR_CS_API
1920
import kotlin.reflect.KProperty
2021
import kotlin.reflect.KType
2122
import kotlin.reflect.typeOf
@@ -70,6 +71,16 @@ public inline fun <T, R> DataColumn<T>.mapIndexed(
7071

7172
public inline fun <T, R> DataFrame<T>.map(transform: RowExpression<T, R>): List<R> = rows().map { transform(it, it) }
7273

74+
public inline fun <T, reified R> DataFrame<T>.mapToColumn(
75+
name: String,
76+
infer: Infer = Infer.Nulls,
77+
noinline body: AddExpression<T, R>,
78+
): DataColumn<R> = mapToColumn(name, typeOf<R>(), infer, body)
79+
80+
@Deprecated(
81+
UNIFIED_SIMILAR_CS_API,
82+
replaceWith = ReplaceWith("expr(name, infer, body)", "org.jetbrains.kotlinx.dataframe.api.Infer"),
83+
)
7384
public inline fun <T, reified R> ColumnsContainer<T>.mapToColumn(
7485
name: String,
7586
infer: Infer = Infer.Nulls,
@@ -92,7 +103,8 @@ public inline fun <T, reified R> ColumnsContainer<T>.mapToColumn(
92103
noinline body: AddExpression<T, R>,
93104
): DataColumn<R> = mapToColumn(column, typeOf<R>(), infer, body)
94105

95-
public fun <T, R> ColumnsContainer<T>.mapToColumn(
106+
@PublishedApi
107+
internal fun <T, R> ColumnsContainer<T>.mapToColumn(
96108
name: String,
97109
type: KType,
98110
infer: Infer = Infer.Nulls,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ internal const val GENERATE_CODE_REPLACE2 =
189189

190190
internal const val GENERATE_INTERFACES = "This function is just here for binary compatibility. $MESSAGE_1_1"
191191

192+
internal const val UNIFIED_SIMILAR_CS_API = "Deprecated duplicated functionality. $MESSAGE_1_1"
192193
// endregion
193194

194195
// region keep across releases

0 commit comments

Comments
 (0)