Skip to content

Add KDocs for pivot with APIs #1994

Description

@zaleslaw

Add KDocs for pivot with APIs

The file core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/with.kt has no KDocs at all. Please add concise KDocs for all four functions.

Scope

All four are the pivot aggregation with(expression):

  • Pivot<T>.with(expression: RowExpression<T, V>): DataRow<T>
  • ReducedPivot<T>.with(expression: RowExpression<T, V>): DataRow<T>
  • PivotGroupBy<T>.with(expression: RowExpression<T, V>): DataFrame<T>
  • ReducedPivotGroupBy<T>.with(expression: RowExpression<T, V>): DataFrame<T>

KDocs should explain

  • What with does: it is a pivot aggregation terminal that fills each pivot cell with the value produced by evaluating expression on the group's rows — the result value type V is captured via the reified type argument.
  • The receiver differences and result shape:
    • Pivot / ReducedPivot produce a single DataRow<T> (one value per pivot column);
    • PivotGroupBy / ReducedPivotGroupBy produce a DataFrame<T> (a value per group × pivot column);
    • the Reduced* variants evaluate the expression on the single reduced row of each group/cell, the non-reduced variants over the whole group.
  • The expression parameter: a RowExpression<T, V> evaluated per group; note (for ReducedPivotGroupBy) that returning a column reference resolves to that column's value.

Test coverage assessment

  • There is no dedicated test file for with.kt. Optional follow-up: cover each receiver variant and the reduced-vs-non-reduced behavior.

Website coverage

  • with is covered on pivot.html (as a pivot aggregation step); keep KDocs consistent with it.

Acceptance criteria

  • All four with overloads have concise KDocs.
  • KDocs state the pivot-aggregation semantics, the DataRow vs DataFrame result per receiver, and the reduced-vs-non-reduced distinction.
  • Docs are consistent with the site page pivot.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    KDocsImprovements or additions to KDocs

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions