Skip to content

Commit 0dbbcf8

Browse files
Automated commit of generated code
1 parent 9dab767 commit 0dbbcf8

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ internal interface FillNaNs {
535535
*
536536
* @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update.
537537
*/
538+
@Interpretable("FillNaNs0")
538539
public fun <T, C> DataFrame<T>.fillNaNs(columns: ColumnsSelector<T, C>): Update<T, C> =
539540
update(columns).where { it.isNaN }
540541

@@ -811,6 +812,7 @@ internal interface FillNA {
811812
*
812813
* @param [columns] The [Columns Selector][org.jetbrains.kotlinx.dataframe.ColumnsSelector] used to select the columns of this [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] to update.
813814
*/
815+
@Interpretable("FillNulls0") // fillNA changes schema same as fillNulls
814816
public fun <T, C> DataFrame<T>.fillNA(columns: ColumnsSelector<T, C?>): Update<T, C?> =
815817
update(columns).where { it.isNA }
816818

@@ -990,6 +992,8 @@ public fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false, columns: Co
990992
* If `true`, rows are dropped if all selected cells are `null`.
991993
* If `false`, rows are dropped if any of the selected cells is `null`.
992994
*/
995+
@Refine
996+
@Interpretable("DropNulls1")
993997
public fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false): DataFrame<T> = dropNulls(whereAllNull) { all() }
994998

995999
/**

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ import org.jetbrains.kotlinx.dataframe.ColumnsSelector
44
import org.jetbrains.kotlinx.dataframe.DataFrame
55
import org.jetbrains.kotlinx.dataframe.DataRow
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.columns.ColumnReference
810
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
911
import org.jetbrains.kotlinx.dataframe.impl.api.implodeImpl
1012
import kotlin.reflect.KProperty
1113

1214
// region DataFrame
1315

16+
@Refine
17+
@Interpretable("ImplodeDefault")
1418
public fun <T> DataFrame<T>.implode(dropNA: Boolean = false): DataRow<T> = implode(dropNA) { all() }[0]
1519

20+
@Refine
21+
@Interpretable("Implode")
1622
public fun <T, C> DataFrame<T>.implode(dropNA: Boolean = false, columns: ColumnsSelector<T, C>): DataFrame<T> =
1723
implodeImpl(dropNA, columns)
1824

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ public fun <T, C> DataFrame<T>.update(vararg columns: ColumnReference<C>): Updat
360360
*
361361
* @param [predicate] The [row value filter][RowValueFilter] to select the rows to update.
362362
*/
363+
@Interpretable("UpdateWhere")
363364
public fun <T, C> Update<T, C>.where(predicate: RowValueFilter<T, C>): Update<T, C> =
364365
Update(df = df, filter = filter and predicate, columns = columns)
365366

@@ -381,6 +382,7 @@ public fun <T, C> Update<T, C>.where(predicate: RowValueFilter<T, C>): Update<T,
381382
*
382383
* @param [rowIndices] The indices of the rows to update. Either a [Collection]<[Int]>, an [IntRange], or just `vararg` indices.
383384
*/
385+
@Interpretable("UpdateAt")
384386
public fun <T, C> Update<T, C>.at(rowIndices: Collection<Int>): Update<T, C> = where { index in rowIndices }
385387

386388
/**
@@ -401,6 +403,7 @@ public fun <T, C> Update<T, C>.at(rowIndices: Collection<Int>): Update<T, C> = w
401403
*
402404
* @param [rowIndices] The indices of the rows to update. Either a [Collection]<[Int]>, an [IntRange], or just `vararg` indices.
403405
*/
406+
@Interpretable("UpdateAt")
404407
public fun <T, C> Update<T, C>.at(vararg rowIndices: Int): Update<T, C> = at(rowIndices.toSet())
405408

406409
/**
@@ -421,6 +424,7 @@ public fun <T, C> Update<T, C>.at(vararg rowIndices: Int): Update<T, C> = at(row
421424
*
422425
* @param [rowRange] The indices of the rows to update. Either a [Collection]<[Int]>, an [IntRange], or just `vararg` indices.
423426
*/
427+
@Interpretable("UpdateAt")
424428
public fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C> = where { index in rowRange }
425429

426430
/** ## Per Row Col
@@ -443,6 +447,7 @@ public fun <T, C> Update<T, C>.at(rowRange: IntRange): Update<T, C> = where { in
443447
* - [Update per col][org.jetbrains.kotlinx.dataframe.api.Update.perCol] to provide a new value for every selected cell giving its column.
444448
* @param [expression] The [Row Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRowAndColumn.RowColumnExpression] to provide a new value for every selected cell giving its row and column.
445449
*/
450+
@Interpretable("UpdatePerRowCol")
446451
public inline fun <T, C> Update<T, C>.perRowCol(crossinline expression: RowColumnExpression<T, C, C>): DataFrame<T> =
447452
updateImpl { row, column, _ -> expression(row, column) }
448453

@@ -527,6 +532,7 @@ public fun <T, C, R> Update<T, DataRow<C>>.asFrame(expression: DataFrameExpressi
527532
* @param [values] The [Map]<[String], Value> to provide a new value for every selected cell.
528533
* For each selected column, there must be a value in the map with the same name.
529534
*/
535+
@Interpretable("UpdatePerColMap")
530536
public fun <T, C> Update<T, C>.perCol(values: Map<String, C>): DataFrame<T> =
531537
updateWithValuePerColumnImpl {
532538
values[it.name()] ?: throw IllegalArgumentException("Update value for column ${it.name()} is not defined")
@@ -565,6 +571,7 @@ public fun <T, C> Update<T, C>.perCol(values: Map<String, C>): DataFrame<T> =
565571
*
566572
* @param [values] The [DataRow] to provide a new value for every selected cell.
567573
*/
574+
@Interpretable("UpdatePerColRow")
568575
public fun <T, C> Update<T, C>.perCol(values: AnyRow): DataFrame<T> = perCol(values.toMap() as Map<String, C>)
569576

570577
/**
@@ -592,6 +599,7 @@ public fun <T, C> Update<T, C>.perCol(values: AnyRow): DataFrame<T> = perCol(val
592599
*
593600
* @param [valueSelector] The [Column Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenColumn.ColumnExpression] to provide a new value for every selected cell giving its column.
594601
*/
602+
@Interpretable("UpdatePerCol")
595603
public fun <T, C> Update<T, C>.perCol(valueSelector: ColumnExpression<C, C>): DataFrame<T> =
596604
updateWithValuePerColumnImpl(valueSelector)
597605

@@ -621,6 +629,7 @@ internal infix fun <T, C> RowValueFilter<T, C>?.and(other: RowValueFilter<T, C>)
621629
* `df.`[update][org.jetbrains.kotlinx.dataframe.api.update]` { city }.`[notNull][org.jetbrains.kotlinx.dataframe.api.Update.notNull]` { it.`[toUpperCase][String.toUpperCase]`() }`
622630
*
623631
* @param expression Optional [Row Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowExpression.WithExample] to update the rows with. */
632+
@Interpretable("UpdateNotNullDefault")
624633
public fun <T, C> Update<T, C?>.notNull(): Update<T, C> = where { it != null } as Update<T, C>
625634

626635
/**
@@ -644,6 +653,7 @@ public fun <T, C> Update<T, C?>.notNull(): Update<T, C> = where { it != null } a
644653
*
645654
* @param expression Optional [Row Expression][org.jetbrains.kotlinx.dataframe.documentation.ExpressionsGivenRow.RowExpression.WithExample] to update the rows with.
646655
*/
656+
@Interpretable("UpdateNotNull")
647657
public fun <T, C> Update<T, C?>.notNull(expression: UpdateExpression<T, C, C>): DataFrame<T> =
648658
notNull().with(expression)
649659

0 commit comments

Comments
 (0)