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

[BUG] Unserializatable histogram generated with an empty hist.dask.Hist #586

Open
yimuchen opened this issue Sep 10, 2024 · 0 comments
Open

Comments

@yimuchen
Copy link

Describe the bug

hist.dask.Hist generates an unpickleable object if computed with no fill call

Steps to reproduce

import pickle

import dask
import dask_awkward
import hist.dask
import numpy

import awkward

h = hist.dask.Hist(hist.axis.Regular(10, 0, 1))
# h.fill(
#     dask_awkward.from_awkward(
#         awkward.from_numpy(numpy.random.random(size=20)), npartitions=1
#     )
# )
o = dask.compute(h)
print(o, type(o))
pickle.dump(o, open("hist_dask_test.pkl", "wb"))

Without the fill call, the the output still appears valid at the print statement, but the pickle statement will fail with the message:

Traceback (most recent call last):
  File "hist_dask_nofill.py", line 18, in <module>
    pickle.dump(o, open("hist_dask_test.pkl", "wb"))
AttributeError: Can't pickle local object 'Histogram.__init__.<locals>.<lambda>'

This is seen in the latest version hist==2.8.0

@yimuchen yimuchen changed the title [BUG] [BUG] Unserializatable histogram generated with an empty hist.dask.Hist Sep 10, 2024
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

No branches or pull requests

1 participant