Skip to content
Open
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
autofix_prs: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.2
rev: v0.14.3
hooks:
- id: ruff-check
args: [--exit-non-zero-on-fix]
Expand All @@ -14,7 +14,7 @@ repos:
additional_dependencies: [ tomli ]
args: [-L, "THIRDPARTY"]
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/psf/black
Expand Down
217 changes: 90 additions & 127 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
@@ -1,240 +1,203 @@
from collections.abc import Callable
import sys
from typing import (
Any,
Literal,
overload,
)

from pandas import (
Index,
Series,
)
import numpy as np
from pandas.core.arrays.boolean import BooleanArray
from pandas.core.indexes.base import Index
from pandas.core.series import Series
from typing_extensions import Self

from pandas._typing import Scalar

class NAType:
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
def __format__(self, format_spec: str) -> str: ...
def __hash__(self) -> int: ...
def __reduce__(self) -> str: ...
@overload
def __add__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __add__(self, other: Series, /) -> Series: ...
@overload
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __add__(self, other: Index, /) -> Index: ...
@overload
def __add__(self, other: object, /) -> NAType: ...
def __add__(self, other: Scalar, /) -> NAType: ...
@overload
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __radd__(self, other: Series, /) -> Series: ...
@overload
def __radd__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __radd__(self, other: Index, /) -> Index: ...
if sys.version_info >= (3, 11):
@overload
def __radd__(self, other: Scalar, /) -> NAType: ...
else:
@overload
def __radd__(self, other: Scalar, /) -> NAType: ... # type: ignore[misc]

@overload
def __radd__(self, other: object, /) -> NAType: ...
def __sub__(self, other: Series, /) -> Series: ...
@overload
def __sub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __sub__(self, other: Index, /) -> Index: ...
@overload
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __sub__(self, other: Scalar, /) -> NAType: ...
@overload
def __sub__(self, other: object, /) -> NAType: ...
def __rsub__(self, other: Series, /) -> Series: ...
@overload
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rsub__(self, other: Index, /) -> Index: ...
@overload
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rsub__(self, other: Scalar, /) -> NAType: ...
@overload
def __rsub__(self, other: object, /) -> NAType: ...
def __mul__(self, other: Series, /) -> Series: ...
@overload
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __mul__(self, other: Index, /) -> Index: ...
@overload
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __mul__(self, other: Scalar, /) -> NAType: ...
@overload
def __mul__(self, other: object, /) -> NAType: ...
def __rmul__(self, other: Series, /) -> Series: ...
@overload
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rmul__(self, other: Index, /) -> Index: ...
@overload
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rmul__(self, other: Scalar, /) -> NAType: ...
def __matmul__(self, other: Scalar, /) -> NAType: ...
def __rmatmul__(self, other: Scalar, /) -> NAType: ...
@overload
def __rmul__(self, other: object, /) -> NAType: ...
def __matmul__(self, other: object, /) -> NAType: ...
def __rmatmul__(self, other: object, /) -> NAType: ...
def __truediv__(self, other: Series, /) -> Series: ...
@overload
def __truediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __truediv__(self, other: Index, /) -> Index: ...
@overload
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __truediv__(self, other: Scalar, /) -> NAType: ...
@overload
def __truediv__(self, other: object, /) -> NAType: ...
def __rtruediv__(self, other: Series, /) -> Series: ...
@overload
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rtruediv__(self, other: Index, /) -> Index: ...
@overload
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rtruediv__(self, other: Scalar, /) -> NAType: ...
@overload
def __rtruediv__(self, other: object, /) -> NAType: ...
def __floordiv__(self, other: Series, /) -> Series: ...
@overload
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __floordiv__(self, other: Index, /) -> Index: ...
@overload
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __floordiv__(self, other: Scalar, /) -> NAType: ...
@overload
def __floordiv__(self, other: object, /) -> NAType: ...
def __rfloordiv__(self, other: Series, /) -> Series: ...
@overload
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
@overload
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rfloordiv__(self, other: Index, /) -> Index: ...
@overload
def __rfloordiv__(self, other: object, /) -> NAType: ...
def __rfloordiv__(self, other: Scalar, /) -> NAType: ...
@overload
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __mod__(self, other: Series, /) -> Series: ...
@overload
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __mod__(self, other: Index, /) -> Index: ...
@overload
def __mod__(self, other: object, /) -> NAType: ...
def __mod__(self, other: Scalar, /) -> NAType: ...
@overload
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rmod__(self, other: Series, /) -> Series: ...
@overload
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rmod__(self, other: Index, /) -> Index: ...
@overload
def __rmod__(self, other: object, /) -> NAType: ...
def __rmod__(self, other: Scalar, /) -> NAType: ...
@overload
def __divmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> tuple[Series, Series]: ...
def __divmod__(self, other: Series, /) -> tuple[Series, Series]: ...
@overload
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ...
@overload
def __divmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
def __divmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
@overload
def __rdivmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> tuple[Series, Series]: ...
def __rdivmod__(self, other: Series, /) -> tuple[Series, Series]: ...
@overload
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ...
@overload
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
def __rdivmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
@overload # type: ignore[override]
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __eq__( # pyrefly: ignore[bad-override]
self, other: Series, /
) -> Series[bool]: ...
@overload
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __eq__(self, other: Index, /) -> BooleanArray: ...
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object, /
self, other: Scalar, /
) -> NAType: ...
@overload # type: ignore[override]
def __ne__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __ne__( # pyrefly: ignore[bad-override]
self, other: Series, /
) -> Series[bool]: ...
@overload
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __ne__(self, other: Index, /) -> BooleanArray: ...
@overload
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
self, other: object, /
self, other: Scalar, /
) -> NAType: ...
@overload
def __le__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
def __le__(self, other: Series, /) -> Series[bool]: ...
@overload
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __le__(self, other: Index, /) -> BooleanArray: ...
@overload
def __le__(self, other: object, /) -> NAType: ...
def __le__(self, other: Scalar, /) -> NAType: ...
@overload
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
def __lt__(self, other: Series, /) -> Series[bool]: ...
@overload
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __lt__(self, other: Index, /) -> BooleanArray: ...
@overload
def __lt__(self, other: object, /) -> NAType: ...
def __lt__(self, other: Scalar, /) -> NAType: ...
@overload
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
def __gt__(self, other: Series, /) -> Series[bool]: ...
@overload
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __gt__(self, other: Index, /) -> BooleanArray: ...
@overload
def __gt__(self, other: object, /) -> NAType: ...
def __gt__(self, other: Scalar, /) -> NAType: ...
@overload
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series[bool]: ...
def __ge__(self, other: Series, /) -> Series[bool]: ...
@overload
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
def __ge__(self, other: Index, /) -> BooleanArray: ...
@overload
def __ge__(self, other: object, /) -> NAType: ...
def __ge__(self, other: Scalar, /) -> NAType: ...
def __neg__(self) -> NAType: ...
def __pos__(self) -> NAType: ...
def __abs__(self) -> NAType: ...
def __invert__(self) -> NAType: ...
@overload
def __pow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __pow__(self, other: Series, /) -> Series: ...
@overload
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __pow__(self, other: Index, /) -> Index: ...
@overload
def __pow__(self, other: object, /) -> NAType: ...
def __pow__(self, other: complex, /) -> NAType: ...
@overload
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rpow__(self, other: Series, /) -> Series: ...
@overload
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rpow__(self, other: Index, /) -> Index: ...
@overload
def __rpow__(self, other: object, /) -> NAType: ...
def __rpow__(self, other: complex, /) -> NAType: ...
@overload
def __and__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __and__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __and__(self, other: bool | NAType, /) -> NAType: ...
@overload
def __rand__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __rand__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __rand__(self, other: bool, /) -> NAType: ...
@overload
def __or__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __or__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __or__(self, other: bool | NAType, /) -> NAType: ...
@overload
def __ror__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def __ror__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@overload
def __ror__(self, other: bool | NAType, /) -> NAType: ...
@overload
def __xor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __xor__(self, other: Series, /) -> Series: ...
@overload
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __xor__(self, other: Index, /) -> Index: ...
@overload
def __xor__(self, other: object, /) -> NAType: ...
def __xor__(self, other: bool | np.bool, /) -> NAType: ...
@overload
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
self, other: Series, /
) -> Series: ...
def __rxor__(self, other: Series, /) -> Series: ...
@overload
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
def __rxor__(self, other: Index, /) -> Index: ...
@overload
def __rxor__(self, other: object, /) -> NAType: ...
def __rxor__(self, other: bool | np.bool, /) -> NAType: ...
__array_priority__: int
def __array_ufunc__(
self, ufunc: Callable[..., Any], method: str, *inputs: Any, **kwargs: Any
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ pandas = "2.3.3"
pyarrow = ">=10.0.1"
pytest = ">=8.4.2"
pyright = ">=1.1.407"
ty = ">=0.0.1a24"
pyrefly = ">=0.38.2"
ty = ">=0.0.1a25"
pyrefly = ">=0.39.4"
poethepoet = ">=0.16.5"
loguru = ">=0.6.0"
typing-extensions = ">=4.4.0"
matplotlib = ">=3.10.1"
pre-commit = ">=2.19.0"
pre-commit = ">=4.3.0"
black = ">=25.9.0"
isort = ">=6.0.1"
isort = ">=7.0.0"
openpyxl = ">=3.0.10"
numexpr = ">=2.13.1"
lxml = ">=4.9.1"
Expand Down