-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: Add concatenation of LazyDataFrames #233
Conversation
Parallels df
DF & Series don't have this
@@ -166,6 +166,7 @@ export interface LazyDataFrame extends Serialize, GroupByOps<LazyGroupBy> { | |||
* The `fetch` operation will truly load the first `n`rows lazily. | |||
*/ | |||
head(length?: number): LazyDataFrame; | |||
inner(): any; |
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.
Matches pattern in Series & Dataframe
nodejs-polars/polars/series/index.ts
Line 38 in 093d496
inner(): any; |
nodejs-polars/polars/series/index.ts
Lines 1403 to 1404 in 093d496
inner() { | |
return _s; |
get [Symbol.toStringTag]() { | ||
return "LazyDataFrame"; | ||
}, |
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.
Matches existing pattern. Backs the new isLazyDataFrame
utils
nodejs-polars/polars/dataframe.ts
Lines 1889 to 1891 in 093d496
get [Symbol.toStringTag]() { | |
return "DataFrame"; | |
}, |
Some("vertical") => concat(&ldfs, union_args), | ||
Some("horizontal") => concat_lf_horizontal(&ldfs, union_args), | ||
Some("diagonal") => concat_lf_diagonal( | ||
&ldfs, | ||
UnionArgs { | ||
diagonal: true, | ||
..union_args |
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.
Decided to parse the how
on the rust side, and dispatch to the appropriate functions here, rather than calling different rust functions from the JS side like DataFrame does.
Seemed a bit more concise. Also tried napi string_enums but landed here.
Could use some maintainer eyes 👀 on the args here: the diagonal
option is newly added to UnionArgs, and I'm not entirely sure if it's needed/desired here.
This reverts commit bf9e227. I guess this is needed..
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.
This looks good to me. Thanks @davidgovea
Resolves #232
Exposes the underlying lazy-compatible
concat
,concat_lf_horizontal
, andconcat_lf_diagonal
functions in native.Tried to keep things reasonably inline with existing code. Added tests that verify the behavior 👍