Skip to content
Draft
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
11 changes: 8 additions & 3 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ from pandas.core.window.rolling import (
from typing_extensions import (
Never,
Self,
override,
)
import xarray as xr

Expand Down Expand Up @@ -2190,13 +2191,17 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
axis: int = 0,
) -> Series[_str]: ...
# ignore needed for mypy as we want different results based on the arguments
@overload # type: ignore[override]
@overload
@override
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dr-Irv here is the example with @override, not sure I am using it the right way since it is failing any pipeline.

# pyrefly: ignore # bad-override
def __and__( # pyright: ignore[reportOverlappingOverload]
def __and__(
self, other: bool | list[int] | MaskType
) -> Series[bool]: ...
@overload
def __and__(self, other: int | np_ndarray_anyint | Series[int]) -> Series[int]: ...
def __and__( # pyright: ignore[reportOverlappingOverload]
self, other: int | np_ndarray_anyint | Series[int]
) -> Series[int]: ...
@override
def __eq__(self, other: object) -> Series[_bool]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
@overload
def __floordiv__(self, other: Index[Never] | Series[Never]) -> Series: ...
Expand Down
Loading