Krisztian Szucs created ARROW-10194:
---------------------------------------

             Summary: [Python] Array.to_numpy() with type 
fixed_size_list(int64(), 1) doesn't roundtrip for large integer values
                 Key: ARROW-10194
                 URL: https://issues.apache.org/jira/browse/ARROW-10194
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Krisztian Szucs


Reproducer:

{code:python}
data = [None, [9007199254740993]]
arr = pa.array(data, type=pa.list_(pa.uint64(), 1))
ndarray = arr.to_numpy(zero_copy_only=False)
restored = pa.array(ndarray, type=arr.type)
assert restored.equals(arr)
{code}

Error:

{code}
E       assert False
E        +  where False = <built-in method equals of 
pyarrow.lib.FixedSizeListArray object at 
0x7fc0c86badc0>(<pyarrow.lib.FixedSizeListArray object at 0x7fc068496760>\n[\n  
null,\n  [\n    90071992547409944\n  ]\n])
E        +    where <built-in method equals of pyarrow.lib.FixedSizeListArray 
object at 0x7fc0c86badc0> = <pyarrow.lib.FixedSizeListArray object at 
0x7fc0c86badc0>\n[\n  null,\n  [\n    90071992547409952\n  ]\n].equals
{code}

The inner numpy array ({{ndarray[1]}}) has float64 dtype where the integer gets 
truncated because of the precision.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to