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
2 changes: 1 addition & 1 deletion pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
freq: Frequency | timedelta | None = ...,
axis: AxisIndex = ...,
fill_value: object | None = ...,
) -> Series[S1]: ...
) -> Series[Any]: ...
def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ...
def isin(self, values: Iterable | Series[S1] | dict) -> Series[_bool]: ...
def between(
Expand Down
11 changes: 4 additions & 7 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,19 +417,16 @@ def test_types_sort_values_with_key() -> None:

def test_types_shift() -> None:
s = pd.Series([1, 2, 3], index=pd.date_range("2020", periods=3))
# Return type "Series[int]"" not quite correct
# - https://github.com/pandas-dev/pandas-stubs/issues/1111
# - https://github.com/pandas-dev/pandas-stubs/issues/1110
check(assert_type(s.shift(), "pd.Series[int]"), pd.Series, np.floating)
check(assert_type(s.shift(), "pd.Series[Any]"), pd.Series, np.floating)
check(
assert_type(s.shift(axis=0, periods=1), "pd.Series[int]"),
assert_type(s.shift(axis=0, periods=1), "pd.Series[Any]"),
pd.Series,
np.floating,
)
check(
assert_type(s.shift(-1, fill_value=0), "pd.Series[int]"), pd.Series, np.integer
assert_type(s.shift(-1, fill_value=0), "pd.Series[Any]"), pd.Series, np.integer
)
check(assert_type(s.shift(freq="1D"), "pd.Series[int]"), pd.Series, np.integer)
check(assert_type(s.shift(freq="1D"), "pd.Series[Any]"), pd.Series, np.integer)


def test_types_rank() -> None:
Expand Down
Loading