Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ ci:
autofix_prs: false
repos:
- repo: https://github.com/python/black
rev: 23.11.0
rev: 23.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.13.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.1.8
hooks:
- id: ruff
args: [
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/_libs/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,19 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
@overload
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
@overload
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc]
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[misc]
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
@overload
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc]
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[misc]
def __ne__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...

Expand Down
1 change: 1 addition & 0 deletions pandas-stubs/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class _NatComparison:

class NaTType:
value: np.int64
def __hash__(self) -> int: ...
def asm8(self) -> np.datetime64: ...
def to_datetime64(self) -> np.datetime64: ...
def to_numpy(
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ class Period(PeriodMixin):
# ignore[misc] here because we know all other comparisons
# are False, so we use Literal[False]
@overload
def __eq__(self, other: Period) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __eq__(self, other: Period) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[misc]
def __eq__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[misc]
def __eq__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
@overload
Expand Down Expand Up @@ -133,11 +133,11 @@ class Period(PeriodMixin):
# ignore[misc] here because we know all other comparisons
# are False, so we use Literal[False]
@overload
def __ne__(self, other: Period) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __ne__(self, other: Period) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[misc]
def __ne__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[misc]
def __ne__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...
# Ignored due to indecipherable error from mypy:
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,22 @@ class Timedelta(timedelta):
def __rtruediv__(self, other: timedelta | Timedelta | NaTType) -> float: ...
# Override due to more types supported than dt.timedelta
@overload
def __eq__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __eq__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[misc]
def __eq__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__( # type: ignore[misc]
def __eq__( # type: ignore[overload-overlap]
self, other: TimedeltaIndex | npt.NDArray[np.timedelta64]
) -> npt.NDArray[np.bool_]: ...
@overload
def __eq__(self, other: object) -> Literal[False]: ...
# Override due to more types supported than dt.timedelta
@overload
def __ne__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __ne__(self, other: timedelta | Timedelta | np.timedelta64) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[misc]
def __ne__(self, other: TimedeltaSeries | Series[pd.Timedelta]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__( # type: ignore[misc]
def __ne__( # type: ignore[overload-overlap]
self, other: TimedeltaIndex | npt.NDArray[np.timedelta64]
) -> npt.NDArray[np.bool_]: ...
@overload
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,19 @@ class Timestamp(datetime):
self, other: npt.NDArray[np.timedelta64]
) -> npt.NDArray[np.datetime64]: ...
@overload
def __eq__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __eq__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: TimestampSeries) -> Series[bool]: ... # type: ignore[misc]
def __eq__(self, other: TimestampSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: npt.NDArray[np.datetime64] | Index) -> np_ndarray_bool: ... # type: ignore[misc]
def __eq__(self, other: npt.NDArray[np.datetime64] | Index) -> np_ndarray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
@overload
def __ne__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __ne__(self, other: Timestamp | datetime | np.datetime64) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: TimestampSeries) -> Series[bool]: ... # type: ignore[misc]
def __ne__(self, other: TimestampSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: npt.NDArray[np.datetime64] | Index) -> np_ndarray_bool: ... # type: ignore[misc]
def __ne__(self, other: npt.NDArray[np.datetime64] | Index) -> np_ndarray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...
def __hash__(self) -> int: ...
Expand Down
6 changes: 3 additions & 3 deletions pandas-stubs/core/algorithms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ from pandas._typing import (
# with extension types return the same type while standard type return ndarray

@overload
def unique(values: PeriodIndex) -> PeriodIndex: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def unique(values: PeriodIndex) -> PeriodIndex: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def unique(values: CategoricalIndex) -> CategoricalIndex: ... # type: ignore[misc]
def unique(values: CategoricalIndex) -> CategoricalIndex: ... # type: ignore[overload-overlap]
@overload
def unique(values: IntervalIndex[IntervalT]) -> IntervalIndex[IntervalT]: ... # type: ignore[misc]
def unique(values: IntervalIndex[IntervalT]) -> IntervalIndex[IntervalT]: ... # type: ignore[overload-overlap]
@overload
def unique(values: Index) -> np.ndarray: ...
@overload
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class DataFrame(NDFrame, OpsMixin):
na_value: Scalar = ...,
) -> np.ndarray: ...
@overload
def to_dict( # type: ignore[misc]
def to_dict( # type: ignore[overload-overlap]
self,
orient: Literal["records"],
*,
Expand All @@ -289,31 +289,31 @@ class DataFrame(NDFrame, OpsMixin):
index: Literal[True] = ...,
) -> list[dict[Hashable, Any]]: ...
@overload
def to_dict( # type: ignore[misc]
def to_dict( # type: ignore[overload-overlap]
self,
orient: Literal["dict", "list", "series", "index"],
*,
into: MutableMapping | type[MutableMapping],
index: Literal[True] = ...,
) -> MutableMapping[Hashable, Any]: ...
@overload
def to_dict( # type: ignore[misc]
def to_dict( # type: ignore[overload-overlap]
self,
orient: Literal["split", "tight"],
*,
into: MutableMapping | type[MutableMapping],
index: bool = ...,
) -> MutableMapping[Hashable, Any]: ...
@overload
def to_dict( # type: ignore[misc]
def to_dict( # type: ignore[overload-overlap]
self,
orient: Literal["dict", "list", "series", "index"] = ...,
*,
into: MutableMapping | type[MutableMapping],
index: Literal[True] = ...,
) -> MutableMapping[Hashable, Any]: ...
@overload
def to_dict( # type: ignore[misc]
def to_dict( # type: ignore[overload-overlap]
self,
orient: Literal["split", "tight"] = ...,
*,
Expand Down Expand Up @@ -558,7 +558,7 @@ class DataFrame(NDFrame, OpsMixin):
def T(self) -> DataFrame: ...
def __getattr__(self, name: str) -> Series: ...
@overload
def __getitem__(self, key: Scalar | tuple[Hashable, ...]) -> Series: ... # type: ignore[misc]
def __getitem__(self, key: Scalar | tuple[Hashable, ...]) -> Series: ... # type: ignore[overload-overlap]
@overload
def __getitem__(self, key: Iterable[Hashable] | slice) -> DataFrame: ...
@overload
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/groupby/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class DataFrameGroupBy(GroupBy, Generic[ByT]):
def all(self, skipna: bool = ...) -> DataFrame: ...
# error: Overload 3 for "apply" will never be used because its parameters overlap overload 1
@overload
def apply( # type: ignore[misc]
def apply( # type: ignore[overload-overlap]
self,
func: Callable[[DataFrame], Scalar | list | dict],
*args,
Expand All @@ -167,7 +167,7 @@ class DataFrameGroupBy(GroupBy, Generic[ByT]):
) -> DataFrame: ...
# error: overload 1 overlaps overload 2 because of different return types
@overload
def aggregate(self, arg: Literal["size"]) -> Series: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def aggregate(self, arg: Literal["size"]) -> Series: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def aggregate(self, arg: AggFuncTypeFrame = ..., *args, **kwargs) -> DataFrame: ...
agg = aggregate
Expand Down
30 changes: 15 additions & 15 deletions pandas-stubs/core/indexes/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Index(IndexOpsMixin[S1]):
__hash__: ClassVar[None] # type: ignore[assignment]
# overloads with additional dtypes
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[int | np.integer] | IndexOpsMixin[int] | np_ndarray_anyint,
*,
Expand All @@ -77,7 +77,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> Index[int]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -88,7 +88,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> Index[int]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[float | np.floating] | IndexOpsMixin[float] | np_ndarray_float,
*,
Expand All @@ -99,7 +99,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> Index[float]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -110,7 +110,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> Index[float]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[complex | np.complexfloating]
| IndexOpsMixin[complex]
Expand All @@ -123,7 +123,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> Index[complex]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -135,7 +135,7 @@ class Index(IndexOpsMixin[S1]):
) -> Index[complex]: ...
# special overloads with dedicated Index-subclasses
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[np.datetime64 | datetime] | IndexOpsMixin[datetime],
*,
Expand All @@ -146,7 +146,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> DatetimeIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -157,7 +157,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> DatetimeIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[Period] | IndexOpsMixin[Period],
*,
Expand All @@ -168,7 +168,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> PeriodIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -179,7 +179,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> PeriodIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[np.timedelta64 | timedelta] | IndexOpsMixin[timedelta],
*,
Expand All @@ -190,7 +190,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> TimedeltaIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand All @@ -201,7 +201,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> TimedeltaIndex: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Sequence[Interval[_OrderableT]] | IndexOpsMixin[Interval[_OrderableT]],
*,
Expand All @@ -212,7 +212,7 @@ class Index(IndexOpsMixin[S1]):
**kwargs,
) -> IntervalIndex[Interval[_OrderableT]]: ...
@overload
def __new__( # type: ignore[misc]
def __new__( # type: ignore[overload-overlap]
cls,
data: Iterable,
*,
Expand Down Expand Up @@ -421,7 +421,7 @@ class Index(IndexOpsMixin[S1]):
def __gt__(self, other: Self | S1) -> np_ndarray_bool: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
# overwrite inherited methods from OpsMixin
@overload
def __mul__( # type: ignore[misc]
def __mul__( # type: ignore[overload-overlap]
self: Index[int] | Index[float], other: timedelta
) -> TimedeltaIndex: ...
@overload
Expand Down
12 changes: 6 additions & 6 deletions pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
) -> IntervalIndex[pd.Interval[pd.Timedelta]]: ...
def to_tuples(self, na_tuple: bool = ...) -> pd.Index: ...
@overload
def __contains__(self, key: IntervalT) -> bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __contains__(self, key: IntervalT) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __contains__(self, key: object) -> Literal[False]: ...
def astype(self, dtype: DtypeArg, copy: bool = ...) -> IntervalIndex: ...
Expand Down Expand Up @@ -289,17 +289,17 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
@overload
def __lt__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ...
@overload # type: ignore[override]
def __eq__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __eq__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __eq__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[misc]
def __eq__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object
) -> Literal[False]: ...
@overload # type: ignore[override]
def __ne__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def __ne__(self, other: IntervalT | IntervalIndex[IntervalT]) -> np_ndarray_bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ne__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[misc]
def __ne__(self, other: pd.Series[IntervalT]) -> pd.Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object
Expand All @@ -308,7 +308,7 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
# misc here because int and float overlap but interval has distinct types
# int gets hit first and so the correct type is returned
@overload
def interval_range( # type: ignore[misc] # pyright: ignore[reportOverlappingOverload]
def interval_range( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
start: int = ...,
end: int = ...,
periods: int | None = ...,
Expand Down
Loading