static-frame / arraykit

Python C Extensions for StaticFrame
Other
8 stars 2 forks source link

cannot pickle 'ArrayGO' object #23

Closed flexatone closed 3 years ago

flexatone commented 3 years ago

In updating test from SF, I found that this does not behave as it did in the Python implementation. I have marked the test skipped for now.

________________________ TestUnit.test_array_deepcopy_a ________________________
Traceback (most recent call last):
  File "/home/ariza/src/arraykit/test/test_array_go.py", line 95, in test_array_deepcopy_a
    ag2 = copy.deepcopy(ag1)
  File "/home/ariza/src/py_src/lib/python3.8/copy.py", line 161, in deepcopy
    rv = reductor(4)
TypeError: cannot pickle 'ArrayGO' object
brandtbucher commented 3 years ago

This is actually a great beginner issue (maybe nine lines, total). All we need to do is define a __getnewargs__ method that returns a tuple of arguments to pass to the class constructor.

brandtbucher commented 3 years ago

(So I don't want to take it, but I'm happy to help.)

flexatone commented 3 years ago

Great, I will take a stab at it!