[
https://issues.apache.org/jira/browse/ARROW-3890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16700515#comment-16700515
]
Wes McKinney commented on ARROW-3890:
-------------------------------------
Hm, this works fine for me
{code}
In [1]: paste
import numpy as np
import pyarrow as pa
vec = np.array(["toto", "tata"])
pa.array(vec, pa.string())
## -- End pasted text --
Out[1]:
<pyarrow.lib.StringArray object at 0x7f777aa4b728>
[
"toto",
"tata"
]
{code}
Could you let us know more information about your environment?
> [Python] pa.array of string cannot be created from np.array of string
> ---------------------------------------------------------------------
>
> Key: ARROW-3890
> URL: https://issues.apache.org/jira/browse/ARROW-3890
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 0.11.1
> Reporter: jacques
> Priority: Major
> Labels: parquet
>
> Pyarrow arrays of string cannot be created from numpy arrays of string
> anymore for versions pyarrow>=0.8.0 (this includes pyarrow==0.11.1).
> Please find below a quick repro:
> {code:python}
> import numpy as np
> import pyarrow as pa
> vec = np.array(["toto", "tata"])
> pa.array(vec, pa.string())
> {code}
> Runing this I get the following:
> {code:python}
> ---------------------------------------------------------------------------
> ArrowInvalid Traceback (most recent call last)
> <ipython-input-4-e753fb3a8193> in <module>()
> ----> 1 pa.array(vec, pa.string())
> /usr/local/lib/python2.7/dist-packages/pyarrow/lib.so in pyarrow.lib.array()
> /usr/local/lib/python2.7/dist-packages/pyarrow/lib.so in
> pyarrow.lib._ndarray_to_array()
> /usr/local/lib/python2.7/dist-packages/pyarrow/lib.so in
> pyarrow.lib.check_status()
> ArrowInvalid: 'utf32' codec can't decode bytes in position 0-3: code point
> not in range(0x110000)
> {code}
> However, this code snippet was working fine with pyarrow==0.7.1.
> Was there any behavior change with string in pyarrow since 0.7.1?
> Do you have any workaround for this?
> Jacques
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)