Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class NAType:
@overload
def __eq__(self, other: Index, /) -> BooleanArray: ...
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: Scalar, /
) -> NAType: ...
@overload # type: ignore[override]
Expand All @@ -127,7 +127,7 @@ class NAType:
@overload
def __ne__(self, other: Index, /) -> BooleanArray: ...
@overload
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: Scalar, /
) -> NAType: ...
@overload
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class Timedelta(timedelta):
self, other: np_ndarray[ShapeT, np.integer | np.floating]
) -> np_ndarray[ShapeT, np.timedelta64]: ...
@overload
def __truediv__(
def __truediv__( # ty: ignore[invalid-method-override]
self, other: np_ndarray[ShapeT, np.timedelta64]
) -> np_ndarray[ShapeT, np.floating]: ...
@overload
Expand Down
18 changes: 13 additions & 5 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ class Timestamp(datetime, SupportsIndex):
self, other: np_ndarray[ShapeT, np.datetime64]
) -> np_ndarray[ShapeT, np.bool]: ...
@overload
def __le__(self, other: Series[Timestamp]) -> Series[bool]: ...
def __le__( # ty: ignore[invalid-method-override]
self, other: Series[Timestamp]
) -> Series[bool]: ...
@overload # type: ignore[override]
def __lt__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
Expand All @@ -190,7 +192,9 @@ class Timestamp(datetime, SupportsIndex):
self, other: np_ndarray[ShapeT, np.datetime64]
) -> np_ndarray[ShapeT, np.bool]: ...
@overload
def __lt__(self, other: Series[Timestamp]) -> Series[bool]: ...
def __lt__( # ty: ignore[invalid-method-override]
self, other: Series[Timestamp]
) -> Series[bool]: ...
@overload # type: ignore[override]
def __ge__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
Expand All @@ -200,7 +204,9 @@ class Timestamp(datetime, SupportsIndex):
self, other: np_ndarray[ShapeT, np.datetime64]
) -> np_ndarray[ShapeT, np.bool]: ...
@overload
def __ge__(self, other: Series[Timestamp]) -> Series[bool]: ...
def __ge__( # ty: ignore[invalid-method-override]
self, other: Series[Timestamp]
) -> Series[bool]: ...
@overload # type: ignore[override]
def __gt__(self, other: datetime | np.datetime64 | Self) -> bool: ...
@overload
Expand All @@ -210,7 +216,9 @@ class Timestamp(datetime, SupportsIndex):
self, other: np_ndarray[ShapeT, np.datetime64]
) -> np_ndarray[ShapeT, np.bool]: ...
@overload
def __gt__(self, other: Series[Timestamp]) -> Series[bool]: ...
def __gt__( # ty: ignore[invalid-method-override]
self, other: Series[Timestamp]
) -> Series[bool]: ...
# error: Signature of "__add__" incompatible with supertype "date"/"datetime"
@overload # type: ignore[override]
def __add__(
Expand All @@ -236,7 +244,7 @@ class Timestamp(datetime, SupportsIndex):
@overload
def __sub__(self, other: TimedeltaIndex) -> DatetimeIndex: ...
@overload
def __sub__(
def __sub__( # ty: ignore[invalid-method-override]
self, other: np_ndarray[ShapeT, np.timedelta64]
) -> np_ndarray[ShapeT, np.datetime64]: ...
@overload
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ class Categorical(ExtensionArray):
def take(
self, indexer: TakeIndexer, *, allow_fill: bool = ..., fill_value=...
) -> Categorical: ...
def __contains__(self, key) -> bool: ...
def __contains__(self, item) -> bool: ...
@overload
def __getitem__(self, key: ScalarIndexer) -> Any: ...
@overload
def __getitem__(
def __getitem__( # ty: ignore[invalid-method-override]
self,
key: SequenceIndexer | PositionalIndexerTuple,
) -> Self: ...
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/arrays/datetimelike.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
@overload
def __getitem__(self, key: ScalarIndexer) -> DTScalarOrNaT: ...
@overload
def __getitem__(
def __getitem__( # ty: ignore[invalid-method-override]
self,
key: SequenceIndexer | PositionalIndexerTuple,
item: SequenceIndexer | PositionalIndexerTuple,
) -> Self: ...
def __setitem__( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
self, key: int | Sequence[int] | Sequence[bool] | slice, value
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/arrays/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class IntervalArray(IntervalMixin, ExtensionArray):
self, dtype: NpDtype | None = None, copy: bool | None = None
) -> np_1darray: ...
@overload
def __getitem__(self, key: ScalarIndexer) -> IntervalOrNA: ...
def __getitem__(self, item: ScalarIndexer) -> IntervalOrNA: ...
@overload
def __getitem__(self, key: SequenceIndexer) -> Self: ...
def __getitem__(self, item: SequenceIndexer) -> Self: ...
def __setitem__(self, key, value) -> None: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/arrays/sparse/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class SparseArray(ExtensionArray, ExtensionOpsMixin):
@overload
def __getitem__(self, key: ScalarIndexer) -> Any: ...
@overload
def __getitem__(
def __getitem__( # ty: ignore[invalid-method-override]
self,
key: SequenceIndexer | tuple[int | ellipsis, ...],
item: SequenceIndexer | tuple[int | ellipsis, ...],
) -> Self: ...
def copy(self): ...
def map(self, mapper): ...
Expand Down
26 changes: 13 additions & 13 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ _T_MUTABLE_MAPPING_co = TypeVar(

class _iLocIndexerFrame(_iLocIndexer, Generic[_T]):
@overload
def __getitem__(self, idx: tuple[int, int]) -> Scalar: ...
def __getitem__(self, key: tuple[int, int]) -> Scalar: ...
@overload
def __getitem__(self, idx: IndexingInt) -> Series: ...
def __getitem__(self, key: IndexingInt) -> Series: ...
@overload
def __getitem__(self, idx: tuple[IndexType | MaskType, int]) -> Series: ...
def __getitem__(self, key: tuple[IndexType | MaskType, int]) -> Series: ...
@overload
def __getitem__(self, idx: tuple[int, IndexType | MaskType]) -> Series: ...
def __getitem__(self, key: tuple[int, IndexType | MaskType]) -> Series: ...
@overload
def __getitem__(
self,
idx: (
key: (
IndexType
| MaskType
| tuple[IndexType | MaskType, IndexType | MaskType]
Expand All @@ -203,7 +203,7 @@ class _iLocIndexerFrame(_iLocIndexer, Generic[_T]):
# Keep in sync with `DataFrame.__setitem__`
def __setitem__(
self,
idx: (
key: (
int
| IndexType
| tuple[int, int]
Expand Down Expand Up @@ -262,7 +262,7 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
@overload
def __getitem__(
self,
idx: (
key: (
IndexType
| MaskType
| Callable[[DataFrame], IndexType | MaskType | Sequence[Hashable]]
Expand All @@ -283,7 +283,7 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
@overload
def __setitem__(
self,
idx: (
key: (
MaskType | StrLike | _IndexSliceTuple | list[ScalarT] | IndexingInt | slice
),
value: (
Expand All @@ -302,7 +302,7 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
@overload
def __setitem__(
self,
idx: tuple[_IndexSliceTuple, Hashable],
key: tuple[_IndexSliceTuple, Hashable],
value: (
Scalar
| NAType
Expand All @@ -317,17 +317,17 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
) -> None: ...

class _iAtIndexerFrame(_iAtIndexer):
def __getitem__(self, idx: tuple[int, int]) -> Scalar: ...
def __getitem__(self, key: tuple[int, int]) -> Scalar: ...
def __setitem__(
self,
idx: tuple[int, int],
key: tuple[int, int],
value: Scalar | NAType | NaTType | None,
) -> None: ...

class _AtIndexerFrame(_AtIndexer):
def __getitem__(
self,
idx: tuple[
key: tuple[
int
| StrLike
| Timestamp
Expand All @@ -338,7 +338,7 @@ class _AtIndexerFrame(_AtIndexer):
) -> Scalar: ...
def __setitem__(
self,
idx: (
key: (
MaskType | StrLike | _IndexSliceTuple | list[ScalarT] | IndexingInt | slice
),
value: (
Expand Down
12 changes: 7 additions & 5 deletions pandas-stubs/core/groupby/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SeriesGroupBy(GroupBy[Series[S2]], Generic[S2, ByT]):
# Overrides that provide more precise return types over the GroupBy class
@final # type: ignore[misc]
# pyrefly: ignore # bad-override
def __iter__( # pyright: ignore[reportIncompatibleMethodOverride]
def __iter__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[override-of-final-method]
self,
) -> Iterator[tuple[ByT, Series[S2]]]: ...

Expand Down Expand Up @@ -244,7 +244,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
**kwargs: P.kwargs,
) -> DataFrame: ...
@overload
def apply(
def apply( # ty: ignore[invalid-method-override]
self,
func: DFCallable3[P],
/,
Expand Down Expand Up @@ -297,7 +297,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
@overload
def __getitem__(self, key: Scalar) -> SeriesGroupBy[Any, ByT]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, key: Iterable[Hashable]
) -> DataFrameGroupBy[ByT, _TT]: ...
def nunique(self, dropna: bool = True) -> DataFrame: ...
Expand Down Expand Up @@ -449,11 +449,13 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
) -> Series: ... # Series[Axes] but this is not allowed
@property
def dtypes(self) -> Series: ...
def __getattr__(self, name: str) -> SeriesGroupBy[Any, ByT]: ...
def __getattr__(
self, name: str
) -> SeriesGroupBy[Any, ByT]: ... # ty: ignore[invalid-method-override]
# Overrides that provide more precise return types over the GroupBy class
@final # type: ignore[misc]
# pyrefly: ignore # bad-override
def __iter__( # pyright: ignore[reportIncompatibleMethodOverride]
def __iter__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[override-of-final-method]
self,
) -> Iterator[tuple[ByT, DataFrame]]: ...
@overload
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DatetimeIndex(
self, other: datetime | np.datetime64 | np_ndarray_dt | Self
) -> TimedeltaIndex: ...
@overload
def __sub__( # pyright: ignore[reportIncompatibleMethodOverride]
def __sub__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: timedelta | np.timedelta64 | np_ndarray_td | BaseOffset
) -> Self: ...
def __truediv__( # type: ignore[override] # pyrefly: ignore[bad-override]
Expand Down
14 changes: 7 additions & 7 deletions pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -236,55 +236,55 @@ class IntervalIndex(ExtensionIndex[IntervalT, np.object_], IntervalMixin):
),
) -> IntervalIndex[IntervalT]: ...
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, idx: int
) -> IntervalT: ...
@overload # type: ignore[override]
def __gt__(
self, other: IntervalT | IntervalIndex[IntervalT]
) -> np_1darray_bool: ...
@overload
def __gt__( # pyright: ignore[reportIncompatibleMethodOverride]
def __gt__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: pd.Series[IntervalT]
) -> pd.Series[bool]: ...
@overload # type: ignore[override]
def __ge__(
self, other: IntervalT | IntervalIndex[IntervalT]
) -> np_1darray_bool: ...
@overload
def __ge__( # pyright: ignore[reportIncompatibleMethodOverride]
def __ge__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: pd.Series[IntervalT]
) -> pd.Series[bool]: ...
@overload # type: ignore[override]
def __le__(
self, other: IntervalT | IntervalIndex[IntervalT]
) -> np_1darray_bool: ...
@overload
def __le__( # pyright: ignore[reportIncompatibleMethodOverride]
def __le__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: pd.Series[IntervalT]
) -> pd.Series[bool]: ...
@overload # type: ignore[override]
def __lt__(
self, other: IntervalT | IntervalIndex[IntervalT]
) -> np_1darray_bool: ...
@overload
def __lt__( # pyright: ignore[reportIncompatibleMethodOverride]
def __lt__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: pd.Series[IntervalT]
) -> pd.Series[bool]: ...
@overload # type: ignore[override]
def __eq__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_1darray_bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: object
) -> Literal[False]: ...
@overload # type: ignore[override]
def __ne__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_1darray_bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: object
) -> Literal[True]: ...

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class MultiIndex(Index):
idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
) -> Self: ...
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, key: int
) -> tuple: ...
def append(self, other): ...
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/indexes/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexField
@overload
def __sub__(self, other: NaTType) -> NaTType: ...
@overload
def __sub__( # pyright: ignore[reportIncompatibleMethodOverride]
def __sub__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: TimedeltaIndex | pd.Timedelta
) -> Self: ...
@overload # type: ignore[override]
Expand All @@ -63,7 +63,7 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexField
@overload
def __rsub__(self, other: Self) -> Index: ...
@overload
def __rsub__( # pyright: ignore[reportIncompatibleMethodOverride]
def __rsub__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: NaTType
) -> NaTType: ...
def asof_locs(
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/indexes/range.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RangeIndex(_IndexSubclassBase[int, np.int64]):
def is_monotonic_decreasing(self) -> bool: ...
@property
def has_duplicates(self) -> bool: ...
def factorize(
def factorize( # ty: ignore[invalid-method-override]
self, sort: bool = False, use_na_sentinel: bool = True
) -> tuple[np_1darray_intp, RangeIndex]: ...
@property
Expand All @@ -81,7 +81,7 @@ class RangeIndex(_IndexSubclassBase[int, np.int64]):
idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
) -> Index: ...
@overload
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride]
def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, idx: int
) -> int: ...
def where( # type: ignore[override]
Expand Down
Loading