Kotlin / Kotlin/dataframe

Add KDocs for `values` APIs

Open
#1,993 0 comments 0 reactions 1 assignee Claimed by @zaleslaw View on GitHub
KDocs
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

# Add KDocs for `values` APIs

The file `core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/values.kt` has **no KDocs at all**. Please add concise KDocs for the non-deprecated APIs, excluding deprecated / `@AccessApiOverload` overloads.

Note: `values` in this file has **two different meanings** depending on the receiver; the KDocs must make this distinction clear.

### Scope

Non-deprecated APIs, grouped by the two meanings:

- **Flatten to a sequence (`DataFrame`)** — `DataFrame.values(byRow, columns)`, `DataFrame.values(byRows)`, `DataFrame.valuesNotNull(byRow, columns)`, `DataFrame.valuesNotNull(byRow)`.
- **Aggregation — collect column values per group / pivot cell** — the `values(...)` overloads on `Grouped`, `ReducedGroupBy`, `Pivot`, `ReducedPivot`, `PivotGroupBy`, `ReducedPivotGroupBy` (the selector, `vararg String`, and no-column variants).

Out of scope: all deprecated `vararg columns: AnyColumnReference` / `vararg columns: KProperty<*>` overloads, and the internal `GROUP_BY_VALUES_EXCEPTION_MESSAGE` constant.

### KDocs should explain

- **`DataFrame.values` (flatten):** returns a lazy `Sequence` of all cell values of the selected columns. The `byRow` / `byRows` flag controls traversal order — column-by-column by default (`false`), row-by-row when `true`. `valuesNotNull` is the same but drops `null`s (and returns a non-nullable element type).
- **Aggregation `values`:** for each group / pivot cell, collects the values of the selected columns (defaults to the remaining columns) into the aggregation result. Explain the parameters:
- `dropNA` — exclude `NA`/`null` values;
- `distinct` — keep only distinct values;
- `separate` (pivot variants) — how multiple aggregated columns are laid out;
- the `columns` selector — which columns' values are collected (remaining columns if omitted).
- The `Reduced*` variants: they collect values from the single reduced row per group/cell.
- Mention the `DuplicateColumnPathInsertException` wrapping: the aggregation variants may fail with a duplicate-column error (e.g. after `updateGroups`/`filter`/`add` on groups) and rethrow a more descriptive message.

### Test coverage assessment

- There is **no dedicated test file** for `values.kt`. Optional follow-up: cover the `byRow` order for `DataFrame.values`, `valuesNotNull` null-dropping, and the `dropNA` / `distinct` / `separate` options for the aggregation variants.

### Website coverage

- Documented at `values.html` / `getValues.html`; keep KDocs consistent with those pages.

### Acceptance criteria

- All non-deprecated `values` / `valuesNotNull` overloads have concise KDocs.
- No documentation is added for the deprecated / `@AccessApiOverload` overloads.
- KDocs clearly separate the two meanings: `DataFrame.values` (flatten to a `Sequence`) vs the aggregation `values` (collect per group / pivot cell).
- KDocs cover `byRow`, `dropNA`, `distinct`, and `separate` where they apply.
- Docs are consistent with the site pages `values.html` / `getValues.html`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.