Skip to content

[C++/Python] Casting float NaN to int should raise an error on safe cast #19228

@asfimport

Description

@asfimport

Currently the following code works:

pa.array([np.nan, 1.]).cast(pa.int64())

It produces:

<pyarrow.lib.Int64Array object at 0x111ca6778>
[
  -9223372036854775808,
  1
]

The expected behaviour should be that it raises.

Reporter: Uwe Korn / @xhochy
Assignee: Krisztian Szucs / @kszucs

PRs and other links:

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions