-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Description
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
>>> # adding pyarrow column to missing column changes to nan
>>> import pandas as pd
>>> import numpy as np
>>> df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]})
>>> df1 = df.iloc[:, :2].astype('Int64[pyarrow]')
>>> df2 = df.iloc[1:, 1:].astype('Int64[pyarrow]')
>>> print(df1 + df2)
a b c
0 NaN <NA> NaN
1 NaN 10 NaN
2 NaN 12 NaNIssue Description
When adding two DataFrames with int64[pyarrow] columns, if the columns do not fully overlap (i.e., one DataFrame is missing columns present in the other), the result unexpectedly fills the missing values with NaN instead of pd.NA
Expected Behavior
Types of columns don't change from pyarrow to numpy based
Installed Versions
INSTALLED VERSIONS
commit : 1a3230d
python : 3.11.13
python-bits : 64
OS : Darwin
OS-release : 24.6.0
Version : Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 3.0.0rc0
numpy : 2.4.0rc1
dateutil : 2.9.0.post0
pip : None
Cython : 3.2.2
sphinx : None
IPython : 9.8.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.14.3
bottleneck : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : 6.0.2
matplotlib : 3.10.7
numba : None
numexpr : None
odfpy : None
openpyxl : None
psycopg2 : None
pymysql : None
pyarrow : 22.0.0
pyiceberg : None
pyreadstat : None
pytest : None
python-calamine : None
pytz : 2025.2
pyxlsb : None
s3fs : None
scipy : 1.16.3
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
qtpy : None
pyqt5 : None