BUG: memory issues with string[pyarrow]
after sorted pd.merge
#61322
Labels
Arrow
pyarrow functionality
Bug
Closing Candidate
May be closeable, needs more eyeballs
Upstream issue
Issue related to pandas dependency
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
Issues only occur when series
b
hasdtype
ofstring[pyarrow]
(notstring[python]
)..to_parquet
fails fordf_sort
but succeeds fordf_nosort
.b
is greater indf_sort
than indf_nosort
.df_sort["b"]
is equal todf_nosort["b"]
.Expected Behavior
.to_parquet
to succeed for both dataframes.df_sort["b"]
to have the same memory usage asdf_nosort["b"]
. (I should note, however, that I lack a sophisticated understanding of memory management, so I may be mistaken.)df_nosort["b"].equals(df_sort["b"])
to returnFalse
if the series differ in memory usage. (Same caveat applies.)Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.10.16
python-bits : 64
OS : Darwin
OS-release : 24.4.0
Version : Darwin Kernel Version 24.4.0: Wed Mar 19 21:16:34 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.3
numpy : 2.2.2
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 25.0
Cython : None
sphinx : None
IPython : 8.35.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.3.2
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : 5.3.1
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 19.0.1
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 2.0.39
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
xlsxwriter : None
zstandard : None
tzdata : 2025.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: