Skip to content
Merged
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
5 changes: 5 additions & 0 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex | None = ...,
inplace: Literal[True],
limit: int | None = ...,
limit_area: Literal["inside", "outside"] | None = ...,
downcast: dict | None = ...,
) -> None: ...
@overload
Expand All @@ -1309,6 +1310,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex | None = ...,
inplace: Literal[False] = ...,
limit: int | None = ...,
limit_area: Literal["inside", "outside"] | None = ...,
downcast: dict | None = ...,
) -> Series[S1]: ...
@overload
Expand All @@ -1318,6 +1320,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex | None = ...,
inplace: Literal[True],
limit: int | None = ...,
limit_area: Literal["inside", "outside"] | None = ...,
downcast: dict | None = ...,
) -> None: ...
@overload
Expand All @@ -1327,6 +1330,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex | None = ...,
inplace: Literal[False] = ...,
limit: int | None = ...,
limit_area: Literal["inside", "outside"] | None = ...,
downcast: dict | None = ...,
) -> Series[S1]: ...
@overload
Expand All @@ -1337,6 +1341,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex = ...,
inplace: _bool = ...,
limit: int | None = ...,
limit_area: Literal["inside", "outside"] | None = ...,
downcast: dict | None = ...,
) -> Series[S1] | None: ...
def interpolate(
Expand Down
12 changes: 12 additions & 0 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,13 @@ def test_types_bfill() -> None:
s1 = pd.Series([1, 2, 3])
check(assert_type(s1.bfill(), "pd.Series[int]"), pd.Series, np.integer)
check(assert_type(s1.bfill(inplace=False), "pd.Series[int]"), pd.Series, np.integer)
check(
assert_type(s1.bfill(inplace=False, limit_area="inside"), "pd.Series[int]"),
pd.Series,
np.integer,
)
assert assert_type(s1.bfill(inplace=True), None) is None
assert assert_type(s1.bfill(inplace=True, limit_area="outside"), None) is None


def test_types_ewm() -> None:
Expand Down Expand Up @@ -1205,7 +1211,13 @@ def test_types_ffill() -> None:
s1 = pd.Series([1, 2, 3])
check(assert_type(s1.ffill(), "pd.Series[int]"), pd.Series, np.integer)
check(assert_type(s1.ffill(inplace=False), "pd.Series[int]"), pd.Series, np.integer)
check(
assert_type(s1.ffill(inplace=False, limit_area="inside"), "pd.Series[int]"),
pd.Series,
np.integer,
)
assert assert_type(s1.ffill(inplace=True), None) is None
assert assert_type(s1.ffill(inplace=True, limit_area="outside"), None) is None


def test_types_as_type() -> None:
Expand Down
Loading