You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2020/09/24 08:45:00 UTC
[jira] [Updated] (ARROW-5703) [Python] Arrow cannot serialize
complex scalars in numpy
[ https://issues.apache.org/jira/browse/ARROW-5703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joris Van den Bossche updated ARROW-5703:
-----------------------------------------
Labels: pyarrow-serialization (was: )
> [Python] Arrow cannot serialize complex scalars in numpy
> --------------------------------------------------------
>
> Key: ARROW-5703
> URL: https://issues.apache.org/jira/browse/ARROW-5703
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 0.12.1
> Environment: Miniconda Python 3.7.3
> Numpy 1.16.4
> Reporter: Wenjun Si
> Priority: Minor
> Labels: pyarrow-serialization
>
> When serializing complex scalars in Numpy, PyArrow reports an ArrowNotImplementedError. This can be reproduced with the code below
> {code:python}
> import numpy as np
> import pyarrow as pa
> # this raises ArrowNotImplementedError: Numpy scalar type not recognized
> pa.serialize(np.complex128(1+3j))
> # this runs ok
> pa.serialize(np.array([1+3j]))
> {code}
> and the stack is
> {code}
> ---------------------------------------------------------------------------
> ArrowNotImplementedError Traceback (most recent call last)
> <ipython-input-3-c5863fa706f3> in <module>
> ----> 1 pa.serialize(np.complex128(1+3j))
> ~/miniconda3/lib/python3.7/site-packages/pyarrow/serialization.pxi in pyarrow.lib.serialize()
> ~/miniconda3/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
> ArrowNotImplementedError: Numpy scalar type not recognized
> {code}
> When investigating into cpp/src/arrow/python/serialize.cc we found that the function AppendScalar does not consider complex types.
> Related github discussions: https://github.com/mars-project/mars/issues/476
--
This message was sent by Atlassian Jira
(v8.3.4#803005)