-
Notifications
You must be signed in to change notification settings - Fork 102
feat: Support pickling #641
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #641 +/- ##
=======================================
Coverage 91.18% 91.19%
=======================================
Files 47 47
Lines 5458 5460 +2
=======================================
+ Hits 4977 4979 +2
Misses 481 481 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@malcolmbarrett any chance you might be able to install and check if this does what you need? |
Works great for me! Thanks to you both |
great_tables/_gt_data.py
Outdated
@@ -283,7 +283,10 @@ def __init__( | |||
rowname_col: str | None = None, | |||
groupname_col: str | None = None, | |||
): | |||
pass | |||
self._data = data |
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 feel like this __init__
quirk is related to how I put __new__
in, but I'm not totally sure how to fix it 😅
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.
@machow, thanks for the feedback! I think returning self._d
for __getnewargs__
might be a more correct approach.
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.
LGTM Thanks for this! It might be worth taking a look at how __new__
is used here down the road, which was definitely probably my screw up..!
Fixes: #640
This PR adds support for pickling
GT
. The__getnewargs__
method is relatively new to me, but the implementation appears to be straightforward.Edit: Based on the error message, it seems that providing only the
data=
parameter is sufficient, but I'm unsure if the other three parameters—auto_align=
,rowname_col=
, andgroupname_col=
—are also required.