diff --git a/tests/test_series.py b/tests/test_series.py index 7f51f9ad..1e48aae7 100644 --- a/tests/test_series.py +++ b/tests/test_series.py @@ -3975,3 +3975,11 @@ def test_timedelta_index_cumprod() -> None: if TYPE_CHECKING_INVALID_USAGE: assert_type(as_period_series.cumprod(), Never) + + +def test_series_str_methods() -> None: + """Test the returns of StringMethods match the type of the input series GH1149.""" + s_str = pd.Series(["a", "b"]) + check(assert_type(s_str, "pd.Series[str]"), pd.Series, str) + check(assert_type(s_str.str.upper(), "pd.Series[str]"), pd.Series, str) + check(assert_type(s_str.str.lower(), "pd.Series[str]"), pd.Series, str)