Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
# just failed to generate these so I couldn't match
# them up.
@overload
def __add__(self: Series[Never], other: complex | ListLike) -> Series: ...
def __add__(self: Series[Never], other: _str | complex | ListLike) -> Series: ...
@overload
def __add__(self, other: Index[Never] | Series[Never]) -> Series: ...
@overload
Expand Down
8 changes: 8 additions & 0 deletions tests/series/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4080,3 +4080,11 @@ def test_series_index_setter() -> None:
check(assert_type(sr.index, pd.Index), pd.Index)
sr.index = [2, 3]
check(assert_type(sr.index, pd.Index), pd.Index)


def test_series_add_str() -> None:
"""Test Series.__add__ with Series[Any]."""
df = pd.DataFrame({0: ["a", "b"]})
sr = df[0]

check(assert_type(sr + "c1", pd.Series), pd.Series, str)