-
Notifications
You must be signed in to change notification settings - Fork 75
read -> unfold + Add documentation for unfold #159 #206
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
Conversation
public inline fun <reified T> DataColumn<T>.unfold(): AnyCol = when (kind()) { | ||
ColumnKind.Group, ColumnKind.Frame -> this | ||
else -> when { | ||
isPrimitive() -> this |
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 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?
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.
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.
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.
speaking of, how would you make kdocs in this situation? i'm in dither over this because duplication and maintenance
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.
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
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.
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
?
…arate file. removed File and URL retrieval from unfold method. Moved example of that to replace.md, updated other docs too
No description provided.