-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Pickling type of dtype object fails on NumPy 1.20 #18325
Copy link
Copy link
Closed
Milestone
Description
Reproducing code example:
On NumPy 1.19.5, the following is possible...
In [1]: import pickle
...: import numpy as np
In [2]: t = type(np.arange(10, dtype="int64").dtype)
In [3]: pickle.loads(pickle.dumps(t))
Out[3]: numpy.dtypeHowever on NumPy 1.20.0 we see the following error...
In [1]: import pickle
...: import numpy as np
In [2]: t = type(np.arange(10, dtype="int64").dtype)
In [3]: pickle.loads(pickle.dumps(t))
---------------------------------------------------------------------------
PicklingError Traceback (most recent call last)
<ipython-input-3-c105e6dd98fb> in <module>
----> 1 pickle.loads(pickle.dumps(t))
PicklingError: Can't pickle <class 'numpy.dtype[int64]'>: attribute lookup dtype[int64] on numpy failedNot sure if this is expected to fail, but we encountered this in our test suite when upgrading to NumPy 1.20
Error message:
---------------------------------------------------------------------------
PicklingError Traceback (most recent call last)
<ipython-input-3-c105e6dd98fb> in <module>
----> 1 pickle.loads(pickle.dumps(t))
PicklingError: Can't pickle <class 'numpy.dtype[int64]'>: attribute lookup dtype[int64] on numpy failedNumPy/Python version information:
1.20.0 3.9.1 | packaged by conda-forge | (default, Jan 26 2021, 01:32:59)
[Clang 11.0.1 ]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels