-
Notifications
You must be signed in to change notification settings - Fork 73
explode
docs and tests
#1291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explode
docs and tests
#1291
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very clear :)
@@ -43,11 +115,73 @@ public fun <T, C> DataFrame<T>.explode(vararg columns: KProperty<C>, dropEmpty: | |||
|
|||
// region explode DataRow | |||
|
|||
/** | |||
* 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*it adds
override val Arguments.startingSchema get() = receiver | ||
|
||
override fun Arguments.interpret(): PluginDataFrameSchema { | ||
val columns = selector ?: object : ColumnsResolver { | ||
val columns = columns ?: object : ColumnsResolver { |
There was a problem hiding this comment.
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!
Close #1277