Skip to content

more bugs in arrow string types for nightly to work #1290

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

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions tests/test_string_accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from tests import (
PD_LTE_23,
TYPE_CHECKING_INVALID_USAGE,
check,
np_ndarray_bool,
)
Expand Down Expand Up @@ -50,7 +51,9 @@ def test_string_accessors_boolean_series():
_check(assert_type(s.str.endswith("e"), "pd.Series[bool]"))
_check(assert_type(s.str.endswith(("e", "f")), "pd.Series[bool]"))
_check(assert_type(s.str.fullmatch("apple"), "pd.Series[bool]"))
_check(assert_type(s.str.fullmatch(re.compile(r"apple")), "pd.Series[bool]"))
if PD_LTE_23:
# Bug in 3.0 dev: https://github.com/pandas-dev/pandas/issues/61952
_check(assert_type(s.str.fullmatch(re.compile(r"apple")), "pd.Series[bool]"))
_check(assert_type(s.str.isalnum(), "pd.Series[bool]"))
_check(assert_type(s.str.isalpha(), "pd.Series[bool]"))
_check(assert_type(s.str.isdecimal(), "pd.Series[bool]"))
Expand All @@ -61,7 +64,9 @@ def test_string_accessors_boolean_series():
_check(assert_type(s.str.istitle(), "pd.Series[bool]"))
_check(assert_type(s.str.isupper(), "pd.Series[bool]"))
_check(assert_type(s.str.match("pp"), "pd.Series[bool]"))
_check(assert_type(s.str.match(re.compile(r"pp")), "pd.Series[bool]"))
if PD_LTE_23:
# Bug in 3.0 dev: https://github.com/pandas-dev/pandas/issues/61952
_check(assert_type(s.str.match(re.compile(r"pp")), "pd.Series[bool]"))


def test_string_accessors_boolean_index():
Expand All @@ -84,7 +89,9 @@ def test_string_accessors_boolean_index():
_check(assert_type(idx.str.endswith("e"), np_ndarray_bool))
_check(assert_type(idx.str.endswith(("e", "f")), np_ndarray_bool))
_check(assert_type(idx.str.fullmatch("apple"), np_ndarray_bool))
_check(assert_type(idx.str.fullmatch(re.compile(r"apple")), np_ndarray_bool))
if PD_LTE_23:
# Bug in 3.0 dev: https://github.com/pandas-dev/pandas/issues/61952
_check(assert_type(idx.str.fullmatch(re.compile(r"apple")), np_ndarray_bool))
_check(assert_type(idx.str.isalnum(), np_ndarray_bool))
_check(assert_type(idx.str.isalpha(), np_ndarray_bool))
_check(assert_type(idx.str.isdecimal(), np_ndarray_bool))
Expand All @@ -95,7 +102,9 @@ def test_string_accessors_boolean_index():
_check(assert_type(idx.str.istitle(), np_ndarray_bool))
_check(assert_type(idx.str.isupper(), np_ndarray_bool))
_check(assert_type(idx.str.match("pp"), np_ndarray_bool))
_check(assert_type(idx.str.match(re.compile(r"pp")), np_ndarray_bool))
if PD_LTE_23:
# Bug in 3.0 dev: https://github.com/pandas-dev/pandas/issues/61952
_check(assert_type(idx.str.match(re.compile(r"pp")), np_ndarray_bool))


def test_string_accessors_integer_series():
Expand Down Expand Up @@ -228,10 +237,10 @@ def test_string_accessors_list_series():

# rsplit doesn't accept compiled pattern
# it doesn't raise at runtime but produces a nan
bad_rsplit_result = s.str.rsplit(
re.compile(r"a") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
)
assert bad_rsplit_result.isna().all()
if TYPE_CHECKING_INVALID_USAGE:
bad_rsplit_result = s.str.rsplit(
re.compile(r"a") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
)


def test_string_accessors_list_index():
Expand All @@ -248,10 +257,10 @@ def test_string_accessors_list_index():

# rsplit doesn't accept compiled pattern
# it doesn't raise at runtime but produces a nan
bad_rsplit_result = idx.str.rsplit(
re.compile(r"a") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
)
assert bad_rsplit_result.isna().all()
if TYPE_CHECKING_INVALID_USAGE:
bad_rsplit_result = idx.str.rsplit(
re.compile(r"a") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
)


def test_string_accessors_expanding_series():
Expand Down
Loading