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

[Python] Empty numpy arrays with shape cannot be deserialized #24331

Closed
asfimport opened this issue Mar 15, 2020 · 2 comments
Closed

[Python] Empty numpy arrays with shape cannot be deserialized #24331

asfimport opened this issue Mar 15, 2020 · 2 comments

Comments

@asfimport
Copy link

asfimport commented Mar 15, 2020

In PyArrow 0.16.0, when we try to deserialize a serialized empty Numpy Array with shape, for instance, np.array([[], []]), an ArrowInvalid is raised.

Code reproducing this error:

import numpy as np
import pyarrow
arr = np.array([[], []])
pyarrow.deserialize(pyarrow.serialize(arr).to_buffer())  # this line cannot work

and the error stack is

Traceback (most recent call last):
  File "/Users/wenjun/miniconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3326, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-0ace9226dd72>", line 1, in <module>
    pyarrow.deserialize(pyarrow.serialize(arr).to_buffer())
  File "pyarrow/serialization.pxi", line 476, in pyarrow.lib.deserialize
  File "pyarrow/serialization.pxi", line 438, in pyarrow.lib.deserialize_from
  File "pyarrow/serialization.pxi", line 414, in pyarrow.lib.read_serialized
  File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: strides must not involve buffer over run

The same code works in PyArrow 0.15.x

Reporter: Wenjun Si / @wjsi
Assignee: Wenjun Si / @wjsi

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-8122. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Joris Van den Bossche / @jorisvandenbossche:
Thanks for the report and PR!

Related issue (reported as serialization of empty dataframe): ARROW-7996

@asfimport
Copy link
Author

Wes McKinney / @wesm:
Issue resolved by pull request 6624
#6624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant