Open
Description
Describe the bug, including details regarding any error messages, version, and platform.
Cross post from pandas-dev/pandas#59082
from datetime import datetime, timedelta
import pyarrow as pa
timestamps = [None, datetime(2022, 1, 1, 10, 0, 30), datetime(2022, 1, 1, 10, 1, 0)]
x = pa.array(timestamps, type=pa.timestamp("ms"))
pa.compute.subtract_checked(x, x) # ✅
# convert to pandas and back
y = pa.Array.from_pandas(x.to_pandas())
assert x == y # ✅
pa.compute.subtract_checked(y, x) # ✅
pa.compute.subtract_checked(x, y) # ❌ overflow
- python 3.11
- pyarrow 16.1.0
- pandas 2.2.2
- numpy 2.0.0
Component(s)
Python