BUG: [pyarrow] Bizarre overflow error when subtracting two identical Index
objects.
#59082
Closed
2 of 3 tasks
Labels
Arrow
pyarrow functionality
Bug
Numeric Operations
Arithmetic, Comparison, and Logical operations
Upstream issue
Issue related to pandas dependency
Uh oh!
There was an error while loading. Please reload this page.
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
This one is absolutely baffling to me. Two
Index
objects, despite satisfyingassert_index_equal
, raise an exception when subtracting each other. I guessassert_index_equal
must be omitting some internal differences under the hood?It occurs after encoding and decoding a
timestamp[ms][pyarrow]
index to floating and back totimestamp[ms][pyarrow]
, by subtracting and offset and dividing by some frequency.Even more weird is that it makes a difference how we define the unit:
Moreover, manually computing the difference in
pyarrow
works as well:Expected Behavior
Either
assert_index_equal
should show some discrepancy, ordt
andecoded
should behave interchangably.Installed Versions
INSTALLED VERSIONS
commit : d9cdd2e
python : 3.11.7.final.0
python-bits : 64
OS : Linux
OS-release : 6.5.0-41-generic
Version : #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.0.0
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 70.1.0
pip : 24.1
Cython : None
pytest : 8.2.2
hypothesis : 6.103.5
sphinx : 7.3.7
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.25.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.0
gcsfs : None
matplotlib : 3.9.0
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.4
pandas_gbq : None
pyarrow : 16.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.13.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: