Skip to content

Conversation

AndreiKingsley
Copy link
Collaborator

@AndreiKingsley AndreiKingsley commented Jul 1, 2025

Close #1277

@Jolanrensen Jolanrensen changed the title explode docs and tests explode docs and tests Jul 1, 2025
@Jolanrensen Jolanrensen self-requested a review July 3, 2025 13:05
Copy link
Collaborator

@Jolanrensen Jolanrensen left a comment

Choose a reason for hiding this comment

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

Very nice :) Thanks!

Now you can probably also link from Gather.explodeLists to here or to the website, as it's the same sort of operation.

selector: ColumnsSelector<T, *> = defaultExplodeColumns,
): DataFrame<T> = toDataFrame().explode(dropEmpty, selector)

columns: ColumnsSelector<T, *> = defaultExplodeColumns,
Copy link
Collaborator

Choose a reason for hiding this comment

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

While renaming an argument might not break binary compatibility, it will break source compatibility in some cases. However, as it's almost never named explicitly I think we can let it slide :) This Kotlinconf talk mentions something about compatibility levels if you're interested in them https://youtu.be/JKLqQiYh8GQ?si=gF5LkFq5vAPAxSIG&t=358


/**
* Splits list-like values in the specified [\columns] and spreads them vertically —
* that is, adds a separate row for each element (one value per row).
Copy link
Collaborator

Choose a reason for hiding this comment

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

*it adds

* If no [\columns] are specified, all columns (at any depth) containing
* [List] or [DataFrame] values will be exploded.
*
* If [dropEmpty] is `true`, rows with empty lists or DataFrames will be removed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Either link to [DataFrame] if you want to specifically mention an instance of the class, or write "dataframes"

* ### This `explode` overload
*/
@ExcludeFromSources
internal interface ExplodeDocs
Copy link
Collaborator

Choose a reason for hiding this comment

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

very clear :)


/**
* Splits list-like values in the specified [\columns] of this [DataRow] and spreads them vertically —
* that is, adds a separate row for each element (one value per row)
Copy link
Collaborator

Choose a reason for hiding this comment

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

*it adds

@AndreiKingsley AndreiKingsley merged commit 5449da2 into master Jul 3, 2025
3 checks passed
@AndreiKingsley AndreiKingsley deleted the explode_kdocs branch July 3, 2025 14:29

override fun Arguments.interpret(): PluginDataFrameSchema {
val columns = selector ?: object : ColumnsResolver {
val columns = columns ?: object : ColumnsResolver {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@AndreiKingsley @koperagen make sure to sync this with the actual compiler plugin!

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 KDocs and unit-tests for function explode

2 participants