Skip to content

[Python] Safe cast fails from numpy float64 array with nans to integer #20835

Description

@asfimport

>>> pa.Array.from_pandas(pd.Series([1, None]), type=pa.int32(), safe=True)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "pyarrow/array.pxi", line 474, in pyarrow.lib.Array.from_pandas
   File "pyarrow/array.pxi", line 169, in pyarrow.lib.array
   File "pyarrow/array.pxi", line 69, in pyarrow.lib._ndarray_to_array
   File "pyarrow/error.pxi", line 81, in pyarrow.lib.check_status
 pyarrow.lib.ArrowInvalid: Floating point value truncated

Reporter: Bryan Cutler / @BryanCutler
Assignee: Krisztian Szucs / @kszucs

PRs and other links:

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions