Skip to content

Commit 8c92512

Browse files
committed
simplify missing
1 parent 6e9a209 commit 8c92512

File tree

3 files changed

+88
-135
lines changed

3 files changed

+88
-135
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33
autofix_prs: false
44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: v0.14.2
6+
rev: v0.14.3
77
hooks:
88
- id: ruff-check
99
args: [--exit-non-zero-on-fix]
@@ -14,7 +14,7 @@ repos:
1414
additional_dependencies: [ tomli ]
1515
args: [-L, "THIRDPARTY"]
1616
- repo: https://github.com/PyCQA/isort
17-
rev: 6.0.1
17+
rev: 7.0.0
1818
hooks:
1919
- id: isort
2020
- repo: https://github.com/psf/black

pandas-stubs/_libs/missing.pyi

Lines changed: 83 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -5,236 +5,189 @@ from typing import (
55
overload,
66
)
77

8-
from pandas import (
9-
Index,
10-
Series,
11-
)
8+
import numpy as np
129
from pandas.core.arrays.boolean import BooleanArray
10+
from pandas.core.indexes.base import Index
11+
from pandas.core.series import Series
1312
from typing_extensions import Self
1413

14+
from pandas._typing import Scalar
15+
1516
class NAType:
1617
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
1718
def __format__(self, format_spec: str) -> str: ...
1819
def __hash__(self) -> int: ...
1920
def __reduce__(self) -> str: ...
2021
@overload
21-
def __add__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
22-
self, other: Series, /
23-
) -> Series: ...
22+
def __add__(self, other: Series, /) -> Series: ...
2423
@overload
25-
def __add__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
24+
def __add__(self, other: Index, /) -> Index: ...
2625
@overload
27-
def __add__(self, other: object, /) -> NAType: ...
26+
def __add__(self, other: Scalar, /) -> NAType: ...
2827
@overload
29-
def __radd__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
30-
self, other: Series, /
31-
) -> Series: ...
28+
def __radd__(self, other: Series, /) -> Series: ...
3229
@overload
33-
def __radd__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
30+
def __radd__(self, other: Index, /) -> Index: ...
3431
@overload
35-
def __radd__(self, other: object, /) -> NAType: ...
32+
def __radd__(self, other: Scalar, /) -> NAType: ...
3633
@overload
37-
def __sub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
38-
self, other: Series, /
39-
) -> Series: ...
34+
def __sub__(self, other: Series, /) -> Series: ...
4035
@overload
41-
def __sub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
36+
def __sub__(self, other: Index, /) -> Index: ...
4237
@overload
43-
def __sub__(self, other: object, /) -> NAType: ...
38+
def __sub__(self, other: Scalar, /) -> NAType: ...
4439
@overload
45-
def __rsub__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
46-
self, other: Series, /
47-
) -> Series: ...
40+
def __rsub__(self, other: Series, /) -> Series: ...
4841
@overload
49-
def __rsub__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
42+
def __rsub__(self, other: Index, /) -> Index: ...
5043
@overload
51-
def __rsub__(self, other: object, /) -> NAType: ...
44+
def __rsub__(self, other: Scalar, /) -> NAType: ...
5245
@overload
53-
def __mul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
54-
self, other: Series, /
55-
) -> Series: ...
46+
def __mul__(self, other: Series, /) -> Series: ...
5647
@overload
57-
def __mul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
48+
def __mul__(self, other: Index, /) -> Index: ...
5849
@overload
59-
def __mul__(self, other: object, /) -> NAType: ...
50+
def __mul__(self, other: Scalar, /) -> NAType: ...
6051
@overload
61-
def __rmul__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
62-
self, other: Series, /
63-
) -> Series: ...
52+
def __rmul__(self, other: Series, /) -> Series: ...
6453
@overload
65-
def __rmul__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
54+
def __rmul__(self, other: Index, /) -> Index: ...
6655
@overload
67-
def __rmul__(self, other: object, /) -> NAType: ...
68-
def __matmul__(self, other: object, /) -> NAType: ...
69-
def __rmatmul__(self, other: object, /) -> NAType: ...
56+
def __rmul__(self, other: Scalar, /) -> NAType: ...
57+
def __matmul__(self, other: Scalar, /) -> NAType: ...
58+
def __rmatmul__(self, other: Scalar, /) -> NAType: ...
7059
@overload
71-
def __truediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
72-
self, other: Series, /
73-
) -> Series: ...
60+
def __truediv__(self, other: Series, /) -> Series: ...
7461
@overload
75-
def __truediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
62+
def __truediv__(self, other: Index, /) -> Index: ...
7663
@overload
77-
def __truediv__(self, other: object, /) -> NAType: ...
64+
def __truediv__(self, other: Scalar, /) -> NAType: ...
7865
@overload
79-
def __rtruediv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
80-
self, other: Series, /
81-
) -> Series: ...
66+
def __rtruediv__(self, other: Series, /) -> Series: ...
8267
@overload
83-
def __rtruediv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
68+
def __rtruediv__(self, other: Index, /) -> Index: ...
8469
@overload
85-
def __rtruediv__(self, other: object, /) -> NAType: ...
70+
def __rtruediv__(self, other: Scalar, /) -> NAType: ...
8671
@overload
87-
def __floordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
88-
self, other: Series, /
89-
) -> Series: ...
72+
def __floordiv__(self, other: Series, /) -> Series: ...
9073
@overload
91-
def __floordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
74+
def __floordiv__(self, other: Index, /) -> Index: ...
9275
@overload
93-
def __floordiv__(self, other: object, /) -> NAType: ...
76+
def __floordiv__(self, other: Scalar, /) -> NAType: ...
9477
@overload
95-
def __rfloordiv__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
96-
self, other: Series, /
97-
) -> Series: ...
78+
def __rfloordiv__(self, other: Series, /) -> Series: ...
9879
@overload
99-
def __rfloordiv__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
80+
def __rfloordiv__(self, other: Index, /) -> Index: ...
10081
@overload
101-
def __rfloordiv__(self, other: object, /) -> NAType: ...
82+
def __rfloordiv__(self, other: Scalar, /) -> NAType: ...
10283
@overload
103-
def __mod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
104-
self, other: Series, /
105-
) -> Series: ...
84+
def __mod__(self, other: Series, /) -> Series: ...
10685
@overload
107-
def __mod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
86+
def __mod__(self, other: Index, /) -> Index: ...
10887
@overload
109-
def __mod__(self, other: object, /) -> NAType: ...
88+
def __mod__(self, other: Scalar, /) -> NAType: ...
11089
@overload
111-
def __rmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
112-
self, other: Series, /
113-
) -> Series: ...
90+
def __rmod__(self, other: Series, /) -> Series: ...
11491
@overload
115-
def __rmod__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
92+
def __rmod__(self, other: Index, /) -> Index: ...
11693
@overload
117-
def __rmod__(self, other: object, /) -> NAType: ...
94+
def __rmod__(self, other: Scalar, /) -> NAType: ...
11895
@overload
119-
def __divmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
120-
self, other: Series, /
121-
) -> tuple[Series, Series]: ...
96+
def __divmod__(self, other: Series, /) -> tuple[Series, Series]: ...
12297
@overload
123-
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
98+
def __divmod__(self, other: Index, /) -> tuple[Index, Index]: ...
12499
@overload
125-
def __divmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
100+
def __divmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
126101
@overload
127-
def __rdivmod__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
128-
self, other: Series, /
129-
) -> tuple[Series, Series]: ...
102+
def __rdivmod__(self, other: Series, /) -> tuple[Series, Series]: ...
130103
@overload
131-
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ... # type: ignore[overload-overlap]
104+
def __rdivmod__(self, other: Index, /) -> tuple[Index, Index]: ...
132105
@overload
133-
def __rdivmod__(self, other: object, /) -> tuple[NAType, NAType]: ...
106+
def __rdivmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
134107
@overload # type: ignore[override]
135-
def __eq__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
136-
self, other: Series, /
137-
) -> Series[bool]: ...
108+
def __eq__(self, other: Series, /) -> Series[bool]: ...
138109
@overload
139-
def __eq__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
110+
def __eq__(self, other: Index, /) -> BooleanArray: ...
140111
@overload
141112
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride]
142-
self, other: object, /
113+
self, other: Scalar, /
143114
) -> NAType: ...
144115
@overload # type: ignore[override]
145-
def __ne__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
146-
self, other: Series, /
147-
) -> Series[bool]: ...
116+
def __ne__(self, other: Series, /) -> Series[bool]: ...
148117
@overload
149-
def __ne__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
118+
def __ne__(self, other: Index, /) -> BooleanArray: ...
150119
@overload
151120
def __ne__( # pyright: ignore[reportIncompatibleMethodOverride]
152-
self, other: object, /
121+
self, other: Scalar, /
153122
) -> NAType: ...
154123
@overload
155-
def __le__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
156-
self, other: Series, /
157-
) -> Series[bool]: ...
124+
def __le__(self, other: Series, /) -> Series[bool]: ...
158125
@overload
159-
def __le__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
126+
def __le__(self, other: Index, /) -> BooleanArray: ...
160127
@overload
161-
def __le__(self, other: object, /) -> NAType: ...
128+
def __le__(self, other: Scalar, /) -> NAType: ...
162129
@overload
163-
def __lt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
164-
self, other: Series, /
165-
) -> Series[bool]: ...
130+
def __lt__(self, other: Series, /) -> Series[bool]: ...
166131
@overload
167-
def __lt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
132+
def __lt__(self, other: Index, /) -> BooleanArray: ...
168133
@overload
169-
def __lt__(self, other: object, /) -> NAType: ...
134+
def __lt__(self, other: Scalar, /) -> NAType: ...
170135
@overload
171-
def __gt__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
172-
self, other: Series, /
173-
) -> Series[bool]: ...
136+
def __gt__(self, other: Series, /) -> Series[bool]: ...
174137
@overload
175-
def __gt__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
138+
def __gt__(self, other: Index, /) -> BooleanArray: ...
176139
@overload
177-
def __gt__(self, other: object, /) -> NAType: ...
140+
def __gt__(self, other: Scalar, /) -> NAType: ...
178141
@overload
179-
def __ge__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
180-
self, other: Series, /
181-
) -> Series[bool]: ...
142+
def __ge__(self, other: Series, /) -> Series[bool]: ...
182143
@overload
183-
def __ge__(self, other: Index, /) -> BooleanArray: ... # type: ignore[overload-overlap]
144+
def __ge__(self, other: Index, /) -> BooleanArray: ...
184145
@overload
185-
def __ge__(self, other: object, /) -> NAType: ...
146+
def __ge__(self, other: Scalar, /) -> NAType: ...
186147
def __neg__(self) -> NAType: ...
187148
def __pos__(self) -> NAType: ...
188149
def __abs__(self) -> NAType: ...
189150
def __invert__(self) -> NAType: ...
190151
@overload
191-
def __pow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
192-
self, other: Series, /
193-
) -> Series: ...
152+
def __pow__(self, other: Series, /) -> Series: ...
194153
@overload
195-
def __pow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
154+
def __pow__(self, other: Index, /) -> Index: ...
196155
@overload
197-
def __pow__(self, other: object, /) -> NAType: ...
156+
def __pow__(self, other: complex, /) -> NAType: ...
198157
@overload
199-
def __rpow__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
200-
self, other: Series, /
201-
) -> Series: ...
158+
def __rpow__(self, other: Series, /) -> Series: ...
202159
@overload
203-
def __rpow__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
160+
def __rpow__(self, other: Index, /) -> Index: ...
204161
@overload
205-
def __rpow__(self, other: object, /) -> NAType: ...
162+
def __rpow__(self, other: complex, /) -> NAType: ...
206163
@overload
207-
def __and__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
164+
def __and__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
208165
@overload
209166
def __and__(self, other: bool | NAType, /) -> NAType: ...
210167
@overload
211-
def __rand__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
168+
def __rand__(self, other: Literal[False], /) -> Literal[False]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
212169
@overload
213170
def __rand__(self, other: bool, /) -> NAType: ...
214171
@overload
215-
def __or__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
172+
def __or__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
216173
@overload
217174
def __or__(self, other: bool | NAType, /) -> NAType: ...
218175
@overload
219-
def __ror__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
176+
def __ror__(self, other: Literal[True], /) -> Literal[True]: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
220177
@overload
221178
def __ror__(self, other: bool | NAType, /) -> NAType: ...
222179
@overload
223-
def __xor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
224-
self, other: Series, /
225-
) -> Series: ...
180+
def __xor__(self, other: Series, /) -> Series: ...
226181
@overload
227-
def __xor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
182+
def __xor__(self, other: Index, /) -> Index: ...
228183
@overload
229-
def __xor__(self, other: object, /) -> NAType: ...
184+
def __xor__(self, other: bool | np.bool, /) -> NAType: ...
230185
@overload
231-
def __rxor__( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
232-
self, other: Series, /
233-
) -> Series: ...
186+
def __rxor__(self, other: Series, /) -> Series: ...
234187
@overload
235-
def __rxor__(self, other: Index, /) -> Index: ... # type: ignore[overload-overlap]
188+
def __rxor__(self, other: Index, /) -> Index: ...
236189
@overload
237-
def __rxor__(self, other: object, /) -> NAType: ...
190+
def __rxor__(self, other: bool | np.bool, /) -> NAType: ...
238191
__array_priority__: int
239192
def __array_ufunc__(
240193
self, ufunc: Callable[..., Any], method: str, *inputs: Any, **kwargs: Any

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ pandas = "2.3.3"
4242
pyarrow = ">=10.0.1"
4343
pytest = ">=8.4.2"
4444
pyright = ">=1.1.407"
45-
ty = ">=0.0.1a24"
45+
ty = ">=0.0.1a25"
4646
pyrefly = ">=0.38.2"
4747
poethepoet = ">=0.16.5"
4848
loguru = ">=0.6.0"
4949
typing-extensions = ">=4.4.0"
5050
matplotlib = ">=3.10.1"
51-
pre-commit = ">=2.19.0"
51+
pre-commit = ">=4.3.0"
5252
black = ">=25.9.0"
53-
isort = ">=6.0.1"
53+
isort = ">=7.0.0"
5454
openpyxl = ">=3.0.10"
5555
numexpr = ">=2.13.1"
5656
lxml = ">=4.9.1"

0 commit comments

Comments
 (0)