Skip to content

BUG: comparing strings of different dtypes errors #61570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
a-reich opened this issue Jun 5, 2025 · 0 comments
Open
2 of 3 tasks

BUG: comparing strings of different dtypes errors #61570

a-reich opened this issue Jun 5, 2025 · 0 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@a-reich
Copy link

a-reich commented Jun 5, 2025

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

import pandas as pd, numpy as np
arr1 = pd.array([],pd.StringDtype("pyarrow", na_value=pd.NA))
arr2 = pd.array([], pd.StringDtype("python", na_value=np.nan))
arr1 == arr2 # NotImplementedError: eq not implemented for <class 'pandas.core.arrays.string_.StringArrayNumpySemantics'>

Issue Description

This appears to be the type of issue discussed in #60639. That issue was closed, but I got an error when I tried running the above reproducer on the example given in the whatsnew for release 2.3.

My understanding was that the issue was closed when #61138 was merged to main, but it's unclear if the fix was successfully backported to the 2.3.x branch. I haven't had the time yet to try when building pandas myself from main.

Expected Behavior

Comparisons of string arrays/series with different dtypes should not error and the return dtype should follow the behavior laid out in #60639 .

Installed Versions

INSTALLED VERSIONS

commit : 2cc3762
python : 3.12.2
python-bits : 64
OS : Linux
OS-release : 6.6.87.1-microsoft-standard-WSL2
Version : #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : C.UTF-8

pandas : 2.3.0
numpy : 2.2.6
pytz : 2025.2
dateutil : 2.9.0.post0
pip : None
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : None
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 20.0.0
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2025.2
qtpy : None
pyqt5 : None

@a-reich a-reich added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 5, 2025
@a-reich a-reich mentioned this issue Jun 5, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

1 participant