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

Fix pickling state #6245

Merged
merged 7 commits into from
Jun 7, 2024
Merged

Fix pickling state #6245

merged 7 commits into from
Jun 7, 2024

Conversation

ahuang11
Copy link
Collaborator

@ahuang11 ahuang11 commented May 22, 2024

Closes #6244

Not sure why it previously sets to an empty dict, but this makes pickling restore to its original state.

import pickle
import holoviews as hv
hv.extension("bokeh")

curve = hv.Curve([0, 1, 2], kdims=["XAXIS"])
pickle.loads(pickle.dumps(curve))
image

First introduced:
https://github.com/holoviz/holoviews/blame/849cd07779be75ff4e4366b3f3f13252afaa43d1/holoviews/core/dimension.py#L764

Prior to that (10 years ago xD):
https://github.com/holoviz/holoviews/blame/7c73cefe76c55d10323edcfcd14874cfdbcfc7a9/holoviews/core/dimension.py#L906

I think it might have been an oversight since AttrTree uses d
https://github.com/holoviz/holoviews/blob/main/holoviews/core/dimension.py#L1353

@hoxbro hoxbro added the type: bug Something isn't correct or isn't working label May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.53%. Comparing base (dd0e4d5) to head (f47ffea).
Report is 1 commits behind head on main.

Files Patch % Lines
holoviews/core/dimension.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6245   +/-   ##
=======================================
  Coverage   88.53%   88.53%           
=======================================
  Files         323      323           
  Lines       67797    67797           
=======================================
+ Hits        60021    60024    +3     
+ Misses       7776     7773    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro hoxbro added this to the 1.19.0 milestone May 22, 2024
@philippjfr philippjfr merged commit d6b2d95 into main Jun 7, 2024
14 checks passed
@philippjfr philippjfr deleted the fix_pickling branch June 7, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HoloViews kdims go missing when sent to a separate process
3 participants