Closed
Description
import pandas as pd
import pyarrow as pa
ser = pd.Series(["aafootwo", "aabartwo", pd.NA, "aabazqux"], dtype="string[pyarrow]")
ser2 = ser.astype(pd.ArrowDtype(pa.string()))
>>> ser.str.slice(None, None, -1)
0 owtoofaa
1 owtrabaa
2 <NA>
3 xuqzabaa
dtype: string
>>> ser2.str.slice(None, None, -1)
0 a
1 a
2 <NA>
3 a
dtype: string[pyarrow]
This looks to me like the ArrowEA version is wrong, can @mroeschke or @jorisvandenbossche confirm this is not intentional?
The ArrowEA version's only test is in test_str_slice
in tests/extension/test_arrow.py, has no test cases with either stop=None or step<0. The StringDtype version has a test_slice
in tests/strings/test_strings.py that has a bit better coverage.