-
Notifications
You must be signed in to change notification settings - Fork 915
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
Adds explode
API
#7607
Adds explode
API
#7607
Conversation
rerun tests |
Codecov Report
@@ Coverage Diff @@
## branch-0.19 #7607 +/- ##
===============================================
+ Coverage 81.86% 82.49% +0.62%
===============================================
Files 101 101
Lines 16884 17397 +513
===============================================
+ Hits 13822 14351 +529
+ Misses 3062 3046 -16
Continue to review full report at Codecov.
|
Pandas also allows calling |
res._data.multiindex = self._data.multiindex | ||
res._data._level_names = self._data._level_names |
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.
Do we not have a helper function that handles all of the "gotchas" in 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.
Checked with @shwina, and can't think of any.. ._data
is constructed inside from_unique_ptr
, which has no information about multiindex
and _level_names.
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 agree it's not ideal. One alternative I've considered in the past is a custom ColumnMeta
type containing information about column names:
class ColumnMeta:
names: Tuple[Any]
multiindex: bool
level_names: Tuple[Any]
And we pass objects of that type as arguments to ._from_unique_ptr
:
cdef from_unique_ptr(unique_ptr[table] c_tbl, ColumnMeta data_meta, ColumnMeta index_meta=None):
pass
Maybe a bit out of scope for this PR though.
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.
Definitely out of scope for this PR, but I like it a lot.
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.
Is ColumnMeta
owned and maintained by some class? Or is it a message interface that gets created on the fly and passes around classes?
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.
Good question -- I think we should have a separate discussion about this outside the context of this PR. Happy to sync offline and then raise an issue?
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 minor doc issue, otherwise LGTM!
Minor doc fixes needed, else LGTM |
Co-authored-by: GALI PREM SAGAR <[email protected]>
@gpucibot merge |
Closes #2975
This PR introduces
explode
API, which flattens list columns and turns list elements into rows. Example:Supersedes #7538