hgrecco / pint-pandas

Pandas support for pint
Other
170 stars 42 forks source link

PintArray fails to fit into a pickle jar #71

Closed jparal closed 2 years ago

jparal commented 3 years ago

I am wondering if anyone has a quick workaround for pickling of PintArray. I am getting an error running following snippet (Python 3.8, pint-pandas 0.2):

import pickle, pint_pandas
pickle.dumps(pint_pandas.PintArray([1.], dtype="m"))

# AttributeError: Can't pickle local object 'build_quantity_class.<locals>.Quantity'

It is also possible I am doing something totally wrong. Any ideas? Thx

jparal commented 3 years ago

A quick update, the pint-pandas==0.1.0 works as expected.