Add KDocs for the four xs overloads (#1995) - #2052
Open
zaleslaw wants to merge 1 commit into
Open
Conversation
…ey columns Detailed the API documentation and examples for `xs` across `DataFrame` and `GroupBy`, including KDoc snippets and markdown tables. Added comprehensive tests for behavior and validation scenarios on key column selections and default behavior. Updated guidelines to standardize the representation of data transformations in examples.
zaleslaw
requested review from
AndreiKingsley and
Jolanrensen
and
a balanced review from Copilot
August 27, 2026 14:45
Contributor
There was a problem hiding this comment.
Pull request overview
Adds comprehensive KDocs and regression coverage for all four xs overloads without changing runtime behavior.
Changes:
- Documents cross-section semantics, key selection, column removal, and examples.
- Adds 14 tests covering ordering, nested columns, errors, and
GroupBy. - Clarifies KoDEx and KDoc authoring guidance.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
KODEX_KDOC_PREPROCESSING.md |
Clarifies tag-brace usage. |
KDOC_GUIDELINES.md |
Adds guidance for parameter references and example tables. |
core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/xs.kt |
Adds focused xs tests. |
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt |
Adds the xs documentation URL. |
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/xs.kt |
Documents all four overloads with shared snippets and examples. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add KDocs for the four
xsoverloads (#1995)xsreturns a cross-section of aDataFrameor aGroupBy.All four overloads had no KDoc, and the operation is easy to get wrong: besides filtering rows it also
removes the key columns, and when you pass no selector it picks the key columns
for you — the first
ncolumns, looking inside column groups.GroupBy.xsworks ontwo sides at once, the keys and the groups. The new docs are built around these
three points.
What changed
core/…/api/xs.ktcore/…/documentation/DocumentationUrls.ktXsentry with the link toxs.html.core/…/test/…/api/xs.ktXsTests, 14 tests.KDOC_GUIDELINES.mdKODEX_KDOC_PREPROCESSING.md{}.Examples
Every overload shows the input as a table, then the call and its result — the layout
concatWithKeysalready uses. The data and the twoDataFramecalls are taken fromthe
xspage on the documentation website, so the KDoc, the website and the testsshow one example instead of three different ones. The website data has a column group,
which makes the "a group is not counted, its columns are" rule visible instead of only
stated.
Tests
Before this PR
xshadDataFrameTests.xs, three scattered cases inDataFrameTests/DataFrameTreeTests, and onegroupBy xstest that only printed itsresult. Return types, pairing order and row order were not checked at all, and
GroupBy.xshad no real assertions.default key columns are the first columns and are removedDataFrame<T>, removal of the key column, original row orderkey values are paired with key columns by positiona column group is not counted as a key column but its columns areexplicit key columns are paired in selection ordernumber of key values must be equal to the number of key columnsIllegalArgumentException, for three overloadsgroupBy xs filters keys and groups and removes the key columns from bothGroupBy<T, G>; the key column is gone from the keys and from the groupsgroupBy xs default key columns are the first key columnsgroupBy xs explicit key columns are paired in selection orderGroupBygroupBy xs key column present only in the keysgroupBy xs key column present only in the groupsKDoc example - …(4 tests)Return types are asserted with explicit type annotations, so the compiler is the
assertion. Expected values are written out, not computed by a second implementation of
the same logic.