-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add variableName and valueName to unpivot #246
base: main
Are you sure you want to change the base?
Conversation
7388e3f
to
cda55a4
Compare
cda55a4
to
dbbf68e
Compare
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.
one small nit, but otherwise looks good!
unpivot(idVars: ColumnSelection, valueVars: ColumnSelection): LazyDataFrame; | ||
/** | ||
* @see {@link DataFrame.unpivot} | ||
* @param options.streamable - Allow this node to run in the streaming engine. |
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.
can you specify that this is false
by default.
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'm confused about the default value.
For dataframes, it's false and cannot be changed: https://github.com/pola-rs/polars/blob/28d81963c1c03d64f6a71396da61b1668664824d/py-polars/src/dataframe/general.rs#L377, which is fine for this change I guess.
In the rust polars code for lazyframes, it doesn't have a default? I can't really read rust though https://github.com/pola-rs/polars/blob/28d81963c1c03d64f6a71396da61b1668664824d/py-polars/src/lazyframe/mod.rs#L1088
in python, streamable for lazyframes is true by default according to the docs https://docs.pola.rs/api/python/stable/reference/lazyframe/api/polars.LazyFrame.unpivot.html#polars.LazyFrame.unpivot
in nodejs-polars in dataframe.rs https://github.com/pola-rs/nodejs-polars/blob/main/src/lazy/dataframe.rs#L516 it's streamable: streamable.unwrap_or(false),
, which I'm assuming means false by default.
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, yeah I don't have a ton of context into this either. maybe @ritchie46 or @stinodego would have more context.
I also added
streamable
toLazyFrame.unpivot
, though I haven't looked into it what it really does and don't know how to test it.DataFrame.unpivot
doesn't seem to have thestreamable
option: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.unpivot.html#polars.DataFrame.unpivot, so I removed it from there.