Wainberg opened a new issue, #40910:
URL: https://github.com/apache/arrow/issues/40910
### Describe the bug, including details regarding any error messages,
version, and platform.
When you mix `np.float32` or `np.float64` scalars and integers, the result
is `DoubleArray`:
```python
>>> pa.array([np.float32(0.5), 1])
<pyarrow.lib.DoubleArray object at 0x7fabb2f7c0a0>
[
0.5,
1
]
>>> pa.array([np.float64(0.5), 1])
<pyarrow.lib.DoubleArray object at 0x7fabb2f7c220>
[
0.5,
1
]
```
But when you mix `np.float16` or `np.float128` scalars and integers, the
result is `Int64Array`, and the floats are truncated to integers:
```python
>>> pa.array([np.float16(0.5), 1])
<pyarrow.lib.Int64Array object at 0x7fabb2f7c220>
[
0,
1
]
>>> pa.array([np.float128(0.5), 1])
<pyarrow.lib.Int64Array object at 0x7fabb2f7c0a0>
[
0,
1
]
```
### Component(s)
Python
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]