diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index a27ed42c984bf..d4a2bedcfba1a 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -74,7 +74,7 @@ jobs: - name: Install pyright # note: keep version in sync with .pre-commit-config.yaml - run: npm install -g pyright@1.1.230 + run: npm install -g pyright@1.1.245 - name: Build Pandas id: build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd095c03e6fdb..fac09fcf70511 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -89,7 +89,7 @@ repos: types: [python] stages: [manual] # note: keep version in sync with .github/workflows/code-checks.yml - additional_dependencies: ['pyright@1.1.230'] + additional_dependencies: ['pyright@1.1.245'] - repo: local hooks: - id: flake8-rst diff --git a/pandas/_libs/interval.pyi b/pandas/_libs/interval.pyi index bad6013aa58b6..9b727b6278792 100644 --- a/pandas/_libs/interval.pyi +++ b/pandas/_libs/interval.pyi @@ -68,10 +68,12 @@ class Interval(IntervalMixin, Generic[_OrderableT]): left: _OrderableT, right: _OrderableT, closed: IntervalClosedType = ..., - ): ... + ) -> None: ... def __hash__(self) -> int: ... @overload - def __contains__(self: Interval[_OrderableTimesT], _OrderableTimesT) -> bool: ... + def __contains__( + self: Interval[_OrderableTimesT], key: _OrderableTimesT + ) -> bool: ... @overload def __contains__( self: Interval[_OrderableScalarT], key: Union[int, float] @@ -83,9 +85,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]): self: Interval[_OrderableTimesT], y: Timedelta ) -> Interval[_OrderableTimesT]: ... @overload - def __add__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __add__(self: Interval[int], y: float) -> Interval[float]: ... + def __add__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __add__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload @@ -93,9 +95,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]): self: Interval[_OrderableTimesT], y: Timedelta ) -> Interval[_OrderableTimesT]: ... @overload - def __radd__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __radd__(self: Interval[int], y: float) -> Interval[float]: ... + def __radd__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __radd__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload @@ -103,9 +105,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]): self: Interval[_OrderableTimesT], y: Timedelta ) -> Interval[_OrderableTimesT]: ... @overload - def __sub__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __sub__(self: Interval[int], y: float) -> Interval[float]: ... + def __sub__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __sub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload @@ -113,33 +115,33 @@ class Interval(IntervalMixin, Generic[_OrderableT]): self: Interval[_OrderableTimesT], y: Timedelta ) -> Interval[_OrderableTimesT]: ... @overload - def __rsub__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __rsub__(self: Interval[int], y: float) -> Interval[float]: ... + def __rsub__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __rsub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload - def __mul__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __mul__(self: Interval[int], y: float) -> Interval[float]: ... + def __mul__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __mul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload - def __rmul__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __rmul__(self: Interval[int], y: float) -> Interval[float]: ... + def __rmul__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __rmul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload - def __truediv__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __truediv__(self: Interval[int], y: float) -> Interval[float]: ... + def __truediv__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __truediv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ... @overload - def __floordiv__(self: Interval[int], y: int) -> Interval[int]: ... - @overload - def __floordiv__(self: Interval[int], y: float) -> Interval[float]: ... + def __floordiv__( + self: Interval[int], y: _OrderableScalarT + ) -> Interval[_OrderableScalarT]: ... @overload def __floordiv__( self: Interval[float], y: Union[int, float] @@ -157,7 +159,7 @@ class IntervalTree(IntervalMixin): right: np.ndarray, closed: IntervalClosedType = ..., leaf_size: int = ..., - ): ... + ) -> None: ... @property def mid(self) -> np.ndarray: ... @property diff --git a/pyproject.toml b/pyproject.toml index 7b32c5f8eab49..030e6bc3c470c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,6 +156,7 @@ exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version"] # enable subset of "strict" reportDuplicateImport = true reportInvalidStubStatement = true +reportOverlappingOverload = true reportPropertyTypeMismatch = true reportUntypedClassDecorator = true reportUntypedFunctionDecorator = true