Skip to content

Conversation

@AndreiKingsley
Copy link
Collaborator

close #1524

@AndreiKingsley AndreiKingsley marked this pull request as ready for review October 30, 2025 12:21
@AndreiKingsley AndreiKingsley changed the title groupBy docs groupBy Kdocs Oct 30, 2025
@Jolanrensen Jolanrensen reopened this Oct 30, 2025

## Reducing

TODO
Copy link
Collaborator

@Jolanrensen Jolanrensen Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to leave this here like this on the website?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will comment it, should be added later (#1535)

/**
* Groups the specified [columns\] within the [DataFrame].
* Groups the specified [columns\] within the [DataFrame] into
* [column group][ColumnGroup].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*a column group

/**
* Groups the rows of this [DataFrame] based on the values in one or more specified [key columns][cols].
* Each unique value in a key column — or a unique tuple of values for multiple columns —
* defines a group consisting of all rows where the column(s) contain that value combination.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say *the group

* Don't confuse this with [group], which groups column into
* [column group][org.jetbrains.kotlinx.dataframe.columns.ColumnGroup].
*/
internal interface GroupByDocs {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs are amazingly useful!

* [**`groupBy`**][groupBy]**`(`**`moveToTop: `[`Boolean`][Boolean]**` = true) { `**`columns: `[`ColumnsSelector`][ColumnsSelector]**` }`**
*
* {@include [Indent]}
* `\[ `__`.`__[**`sortByGroup`**][GroupBy.sortByGroup]**`() `**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are no closing "]"s on any of the lines

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh it's an or-or thing, uhhm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is wrong :) you can sort multiple times, which can make sense in case of ties. So I'd just put [ .sortByX() ] all on separate lines

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, all () have an unneeded space after them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I added ] to the end of each line, so we need a space in the end.

* @include [PivotGroupByDocs.CommonDescription]
*/
@ExcludeFromSources
internal interface GroupByForPivotDocs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be private too

*
* #### For example:
*
* `pivot.`{@get [OPERATION]}` { length `[and][ColumnsSelectionDsl.and]` age }`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you using @get here? They only serve purpose if these docs are included somewhere else and you need a different operation here. [groupBy][groupBy] is shorter to write even ;P

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, but I'd like to fix it further (not in ths PR) to use Dsl.WithExample with a custom variable name (df by default but with ability to customize it)

*
* #### For example:
*
* `df.`{@get [OPERATION]}`("length", "age")`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

public data class GroupWithKey<T, G>(val key: DataRow<T>, val group: DataFrame<G>)

/**
* A dataframe-like structure that contains all unique combinations of key values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*key-values?

@AndreiKingsley AndreiKingsley merged commit 9661de9 into master Nov 4, 2025
5 checks passed
@AndreiKingsley AndreiKingsley deleted the groupby_kdocs branch November 4, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add groupBy KDocs

3 participants