Skip to content

Commit 8d34d6c

Browse files
committed
Add rename{column}.into(KProperty)
1 parent 2fad96e commit 8d34d6c

File tree

1 file changed

+2
-0
lines changed
  • src/main/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+2
-0
lines changed

src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/rename.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public fun <T, C> RenameClause<T, C>.into(vararg newNames: String): DataFrame<T>
4444
df.move(columns).intoIndexed { col, index ->
4545
col.path.dropLast(1) + newNames[index]
4646
}
47+
public fun <T, C> RenameClause<T, C>.into(vararg newNames: KProperty<C>): DataFrame<T> =
48+
into(*newNames.map { it.name }.toTypedArray())
4749

4850
public fun <T, C> RenameClause<T, C>.into(transform: (ColumnWithPath<C>) -> String): DataFrame<T> =
4951
df.move(columns).into {

0 commit comments

Comments
 (0)