Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sezanzeb
Copy link
Contributor

@sezanzeb sezanzeb commented Jul 15, 2024

I also added streamable to LazyFrame.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 the streamable option: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.unpivot.html#polars.DataFrame.unpivot, so I removed it from there.

Copy link
Collaborator

@universalmind303 universalmind303 left a 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.
Copy link
Collaborator

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.

Copy link
Contributor Author

@sezanzeb sezanzeb Jul 17, 2024

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.

Copy link
Collaborator

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.

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.

2 participants