Skip to content

Commit 918de83

Browse files
committed
migrate usages of deprecated API
1 parent 0bf8f97 commit 918de83

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/merge.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public fun <T, C, R> MergeWithTransform<T, C, R>.into(path: ColumnPath): DataFra
117117
res = res
118118
.removeImpl(allowMissingColumns = true) { path }
119119
.df
120-
.move(mergePath).into { path }
120+
.move { mergePath }.into { path }
121121
}
122122
return res
123123
}

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/transpose.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import kotlin.reflect.typeOf
1515

1616
public fun <T> DataRow<T>.transpose(): DataFrame<NameValuePair<*>> {
1717
val valueColumn = DataColumn.createByInference(NameValuePair<*>::value.columnName, values)
18-
val nameColumn = owner.columnNames().toValueColumn(NameValuePair<*>::name)
18+
val nameColumn = owner.columnNames().toValueColumn(NameValuePair<*>::name.name)
1919
return dataFrameOf(nameColumn, valueColumn).cast()
2020
}
2121

@@ -25,7 +25,7 @@ public inline fun <reified T> AnyRow.transposeTo(): DataFrame<NameValuePair<T>>
2525
internal fun <T> AnyRow.transposeTo(type: KType): DataFrame<NameValuePair<T>> {
2626
val convertedValues = values.map { it?.convertTo(type) as T? }
2727
val valueColumn = DataColumn.createByInference(NameValuePair<T>::value.columnName, convertedValues)
28-
val nameColumn = owner.columnNames().toValueColumn(NameValuePair<T>::name)
28+
val nameColumn = owner.columnNames().toValueColumn(NameValuePair<T>::name.name)
2929
return dataFrameOf(nameColumn, valueColumn).cast()
3030
}
3131

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/valueCounts.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public fun <T> DataFrame<T>.valueCounts(
7272
.asColumnGroup(rows)
7373
.asDataColumn()
7474
.valueCounts(sort, ascending, dropNA, countName)
75-
.ungroup(rows)
75+
.ungroup { rows }
7676
.cast()
7777
}
7878

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/flatten.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal fun <T, C> DataFrame<T>.flattenImpl(
3232
fun getRootPrefix(path: ColumnPath) =
3333
(1 until path.size).asSequence().map { path.take(it) }.first { rootPrefixes.contains(it) }
3434

35-
val result = move { rootPrefixes.toColumnSet().colsAtAnyDepth { !it.isColumnGroup() } }
35+
val result = move { rootPrefixes.toColumnSet().colsAtAnyDepth().filter { !it.isColumnGroup() } }
3636
.into {
3737
val targetPath = getRootPrefix(it.path).dropLast(1)
3838
val nameGen = nameGenerators[targetPath]!!

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ internal fun <T, C, K, R> Gather<T, C, K, R>.gatherImpl(
6262

6363
// explode keys and values
6464
df = when {
65-
keysColumn != null && valuesColumn != null -> df.explode(keysColumn, valuesColumn)
66-
else -> df.explode(keysColumn ?: valuesColumn!!)
65+
keysColumn != null && valuesColumn != null -> df.explode { keysColumn and valuesColumn }
66+
else -> df.explode { keysColumn ?: valuesColumn!! }
6767
}
6868

6969
// explode values in lists
7070
if (explode && valuesColumn != null) {
71-
df = df.explode(valuesColumn)
71+
df = df.explode { valuesColumn }
7272
}
7373
} else {
7474
val nameAndValue = column<List<Pair<K, Any?>>>("nameAndValue")

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/reorder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ internal fun <T, C, V : Comparable<V>> Reorder<T, C>.reorderImpl(
7171
df = if (parentPath.isEmpty()) {
7272
newGroup.cast()
7373
} else {
74-
df.replace(parentPath).with { newGroup.asColumnGroup(it.name()) }
74+
df.replace { parentPath }.with { newGroup.asColumnGroup(it.name()) }
7575
}
7676
}
7777
return df

0 commit comments

Comments
 (0)