Skip to content

Conversation

koperagen
Copy link
Collaborator

No description provided.

@koperagen koperagen requested a review from Jolanrensen December 9, 2022 16:18
public inline fun <reified T> DataColumn<T>.unfold(): AnyCol = when (kind()) {
ColumnKind.Group, ColumnKind.Frame -> this
else -> when {
isPrimitive() -> this
Copy link
Collaborator

Choose a reason for hiding this comment

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

While the name unfold() does make sense for isPrimitive() and the else statement where the object is turned into a dataframe one property at a time, for the reading of a file or url the name read() makes way more sense. Would it be a good idea to have both names? Or is this what you're planning to do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reckon people would use it for the same purpose, thus one function and one name.
It's not clear what function does from its name though. Even read is more like read + replace. So people would have to read docs / kdocs to find out anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

speaking of, how would you make kdocs in this situation? i'm in dither over this because duplication and maintenance

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm I'd definitely keep the old functions, annotate them with

@Deprecated("read is now called unfold", ReplaceWith("unfold"), DeprecationLevel.ERROR)

And then simply KDoc the read() functions with @see unfold

Copy link
Collaborator

@Jolanrensen Jolanrensen Dec 13, 2022

Choose a reason for hiding this comment

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

But what does read/unfold do with a file or url? I'd say it still "read"s those right? Even calling DataFrame.read() I'd see "unfold" as only "unfolding" an object into a dataframe.
Maybe we could make that readFile and readUrl?

@Jolanrensen Jolanrensen changed the title Add documentation for unfold (previously read) #159 read -> unfold + Add documentation for unfold #159 Dec 12, 2022
@Jolanrensen Jolanrensen added the enhancement New feature or request label Dec 13, 2022
@Jolanrensen Jolanrensen added this to the 0.9.0 milestone Dec 13, 2022
koperagen and others added 3 commits December 14, 2022 23:04
…arate file. removed File and URL retrieval from unfold method. Moved example of that to replace.md, updated other docs too
@Jolanrensen Jolanrensen merged commit 4edc881 into master Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants