Skip to content

Commit 5f5b866

Browse files
Automated commit of generated code
1 parent 9f92861 commit 5f5b866

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnReference
44
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
55
import org.jetbrains.kotlinx.dataframe.DataFrame
66
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
7+
import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
8+
import org.jetbrains.kotlinx.dataframe.annotations.Refine
79
import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions
810
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
911
import org.jetbrains.kotlinx.dataframe.columns.SingleColumn
@@ -49,6 +51,8 @@ public fun <T> DataFrame<T>.distinct(): DataFrame<T> = distinctBy { all() }
4951
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
5052
* .
5153
*/
54+
@Refine
55+
@Interpretable("Distinct0")
5256
public fun <T, C> DataFrame<T>.distinct(columns: ColumnsSelector<T, C>): DataFrame<T> = select(columns).distinct()
5357

5458
/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ public fun <T> InsertClause<T>.after(columnPath: ColumnPath): DataFrame<T> {
9494

9595
// region at
9696

97+
@Refine
98+
@Interpretable("InsertAt")
9799
public fun <T> InsertClause<T>.at(position: Int): DataFrame<T> = df.add(column).move(column).to(position)
98100

99101
// endregion

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,8 @@ public fun <T, C> MoveClause<T, C>.under(
985985
* @param [columnIndex] The index specifying the position in the [DataFrame] columns
986986
* * where the selected columns will be moved.
987987
*/
988+
@Refine
989+
@Interpretable("MoveTo")
988990
public fun <T, C> MoveClause<T, C>.to(columnIndex: Int): DataFrame<T> = moveTo(columnIndex)
989991

990992
/**

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/DataFrameTests.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,6 +2340,18 @@ class DataFrameTests : BaseTest() {
23402340
.move { city }.to(1)
23412341
}
23422342

2343+
@Test
2344+
fun `move beyond range of existing column indices`() {
2345+
val res = typed.move { city }.to(11)
2346+
res.columnNames() shouldBe listOf("name", "age", "weight", "city")
2347+
}
2348+
2349+
@Test
2350+
fun `move multiple columns beyond range of existing column indices`() {
2351+
val res = typed.move { city and name }.to(11)
2352+
res.columnNames() shouldBe listOf("age", "weight", "city", "name")
2353+
}
2354+
23432355
@Test
23442356
fun splitIntoThisAndNewColumn() {
23452357
val split = typed.split { name }.by { listOf(it.dropLast(1), it.last()) }.into("name", "lastChar")

0 commit comments

Comments
 (0)