Add KDocs for non-deprecated `percentile` APIs
Open
@Jolanrensen is already working on this.
Since Jul 24, 2026.
KDocs
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Add KDocs for non-deprecated percentile APIs
The file core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/percentile.kt holds the public percentile APIs, and the coverage sheet marks the group percentile/* as missing KDocs. None of these functions are currently documented (there is only a TODO KDocs comment block at the top of the file). Please add concise KDocs for the current non-deprecated APIs only, excluding deprecated and binary-compatibility (@AccessApiOverload) overloads.
Scope
APIs needing KDocs, by receiver (each takes the percentile: Double argument):
DataColumn.*—percentile,percentileOrNull,percentileBy,percentileByOrNull,percentileOf,percentileOfOrNullDataRow.*—rowPercentileOf,rowPercentileOfOrNullDataFrame.*—percentile,percentileOrNull,percentileFor,percentileOf,percentileOfOrNull,percentileBy,percentileByOrNullGrouped.*—percentile,percentileFor,percentileOfGroupBy.*—percentileByPivot.*—percentile,percentileFor,percentileOf,percentileByPivotGroupBy.*—percentile,percentileFor,percentileOf,percentileBy
KDocs should explain
- What each operation returns:
percentile— the percentile value (over the whole column / frame);percentileFor— aDataRow/DataFramewith a separate percentile per selected column;percentileOf— the percentile of a value computed per row/element via the givenexpression;percentileBy— the whole row (or reduced group / pivot) at the given percentile of a comparable selector;- the
*OrNullvariants — the same, but returnnullinstead of failing on empty / all-null input; - the grouped / pivoted variants — computed per group / per pivot cell.
- The type behavior (already captured in the
TODO KDocsblock, lines 31–46):- for primitive numbers the result is
Double(ornull); - for other
Comparabletypes the result is a value of that same type (ornull); - careful: non-primitive numbers follow the comparable rules, not the numeric ones;
- the non-
OrNullvariants fail viasuggestIfNullon empty / all-null input; the*OrNullvariants returnnull.
- for primitive numbers the result is
- The
percentileparameter (aDouble, e.g.50.0for the median) and howskipNaNtreatsNaNin floating-point columns. - The quantile estimation method used:
QuantileEstimationMethod.R8for primitive numbers,R3otherwise;percentileByusesR3. - The KT-76683 caveat: for the lambda-return-type
percentileOf/percentile { }overloads on non-number comparable types, explicit type arguments are required — e.g.df.percentile { intCol }works, but aStringcolumn needsdf.percentile<_, String> { stringCol }(or passing the lambda positionally). This must be shown in the KDoc. - The optional
nameparameter for theGroupedvariants and theseparateparameter for thePivot/PivotGroupByvariants.
Acceptance criteria
- Concise KDocs are added to all non-deprecated
percentile/percentileOrNull/percentileFor/percentileOf/percentileOfOrNull/percentileBy/percentileByOrNull/rowPercentileOf/rowPercentileOfOrNulloverloads inpercentile.kt. - No documentation is added for deprecated /
@AccessApiOverloadoverloads (including theDeprecationLevel.ERRORrowPercentile()/rowPercentileOrNull()stubs). - KDocs cover the
percentileandskipNaNparameters, the primitive-number →Doublevs comparable → same-type return rules, and the empty/all-null behavior (suggestIfNullvsnull). - KDocs document the KT-76683 explicit-type-argument requirement for the non-number comparable lambda overloads.
- KDocs mention the quantile estimation method (
R8for numbers,R3otherwise / forpercentileBy). - KDocs clearly distinguish the value-returning, per-column aggregation (
percentileFor), and row-selecting (percentileBy) variants. - Docs are consistent with the site docs at
percentile.html. - The
TODO KDocscomment block at the top of the file is removed once its content has been folded into the actual KDocs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.