-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Python] Array constructor doesn't support arrow scalars. #33594
Copy link
Copy link
Closed
Description
pa.array([pa.scalar(0)])
ArrowInvalid: Could not convert <pyarrow.Int64Scalar: 0> with type pyarrow.lib.Int64Scalar: did not recognize Python value type when inferring an Arrow data type
pa.array([pa.scalar(0)], 'int64')
ArrowInvalid: Could not convert <pyarrow.Int64Scalar: 0> with type pyarrow.lib.Int64Scalar: tried to convert to int64It seems odd that the array constructors don't recognize their own scalars.
In practice, a list of scalars has to be converted with .as_py() just to be converted back, and that also loses the type information.
Related issues:
Note: This issue was originally created as ARROW-18432. Please see the migration documentation for further details.
Reactions are currently unavailable