You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
str.startswith and str.endswith methods support arguments of type tuple[str, ...]. For dtype "string[pyarrow]" this raises a type error. I've already written a fix and provide a pull request soon.
Expected Behavior
Don't throw an error and exhibit same behaviour as the object type string array and the pandas string extension array.
Installed Versions
pd.show_versions()
INSTALLED VERSIONS
------------------
commit : ba1cccd19da778f0c3a7d6a885685da16a072870
python : 3.11.4.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.90.1-microsoft-standard-WSL2
Version : #1 SMP Fri Jan 27 02:56:13 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
…ng[pyarrow]"` dtype (GH#54942) (#54943)
* TST: added failing tuple tests for `str.startswith` and `str.startswith` (#54942)
* FIX: added fix for `str.startswith` and `str.endswith` with tuple arg for `"string[pyarrow]"` dtype (GH#54942)
* DOCS: added entry to whatsnew
* DOCS: moved contrib note to `Strings` section and fixed typos
* PERF: exchanged boolean array creation to method with less overhead
* CLN: removed unnecessary type checks
* DOCS: removed extra space before GH reference
---------
Co-authored-by: Matthew Roeschke <[email protected]>
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
str.startswith
andstr.endswith
methods support arguments of typetuple[str, ...]
. For dtype"string[pyarrow]"
this raises a type error. I've already written a fix and provide a pull request soon.Expected Behavior
Don't throw an error and exhibit same behaviour as the object type string array and the pandas string extension array.
Installed Versions
pd.show_versions()
INSTALLED VERSIONS ------------------ commit : ba1cccd19da778f0c3a7d6a885685da16a072870 python : 3.11.4.final.0 python-bits : 64 OS : Linux OS-release : 5.15.90.1-microsoft-standard-WSL2 Version : #1 SMP Fri Jan 27 02:56:13 UTC 2023 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8
pandas : 2.1.0
numpy : 1.25.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.2.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.14.0
pandas_datareader : None
bs4 : 4.12.2
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 12.0.1
pyreadstat : None
pyxlsb : 1.0.10
s3fs : None
scipy : 1.11.1
sqlalchemy : 2.0.20
tables : None
tabulate : None
xarray : None
xlrd : 2.0.1
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: