Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ private interface CommonMoveToDocs
* where the selected columns will be moved.
* @param [columns\] The [Columns Selector][ColumnsSelector] used to select the columns of this [DataFrame] to move.
*/
@Refine
@Interpretable("MoveTo1")
public fun <T> DataFrame<T>.moveTo(newColumnIndex: Int, columns: ColumnsSelector<T, *>): DataFrame<T> =
move(columns).to(newColumnIndex)

Expand Down Expand Up @@ -398,6 +400,8 @@ public fun <T> DataFrame<T>.moveToEnd(vararg columns: KProperty<*>): DataFrame<T
* @param [column] The [Column With Path Selector][ColumnsSelector] used to specify
* a path in the [DataFrame] to move columns.
*/
@Refine
@Interpretable("MoveInto1")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What use cases this would support?

Copy link
Collaborator Author

@Jolanrensen Jolanrensen Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see the issue now... I assumed:

move { col }.into { pathOf("some", "new", "path") }, assuming the CS DSL in the compiler plugin supports pathOf() and "path"["of"] :)

And move { col }.into { someColGroup["newName"] }

but it also supports multiple cols with the new name depending on the column given...
It's like a rename.into + move.under

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but that's also the problem with rename.into {} isn't it? we don't know how the user uses the old name or any other column data to generate the new name...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as user can write arbitraty code in the lambda such powerful operations are somewhat impossible to implement in the plugin =( shortcuts like rename { }.removePrefix could cover most popular usages though. Didn't think about move into yet

So let's remove these two for now

public fun <T, C> MoveClause<T, C>.into(
column: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> AnyColumnReference,
): DataFrame<T> =
Expand Down Expand Up @@ -436,6 +440,8 @@ public fun <T, C> MoveClause<T, C>.into(column: String): DataFrame<T> = pathOf(c
* @param [column] The [Column With Path Selector And Indices][ColumnsSelector] used to specify
* a path in the [DataFrame] to move columns.
*/
@Refine
@Interpretable("MoveInto2")
public fun <T, C> MoveClause<T, C>.intoIndexed(
newPathExpression: ColumnsSelectionDsl<T>.(ColumnWithPath<C>, Int) -> AnyColumnReference,
): DataFrame<T> {
Expand Down