Skip to content

Commit 0657417

Browse files
committed
Merge branch 'main' into hotfix/cmp0xff/gh718-drop-tss
2 parents 72c2bd1 + 766cc1d commit 0657417

39 files changed

+2108
-1328
lines changed

pandas-stubs/_libs/interval.pyi

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ from pandas.core.series import TimedeltaSeries
1818
from pandas._typing import (
1919
IntervalClosedType,
2020
IntervalT,
21-
np_ndarray_bool,
21+
np_1darray,
2222
npt,
2323
)
2424

@@ -167,7 +167,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
167167
@overload
168168
def __gt__(self, other: Interval[_OrderableT]) -> bool: ...
169169
@overload
170-
def __gt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
170+
def __gt__(
171+
self: IntervalT, other: IntervalIndex[IntervalT]
172+
) -> np_1darray[np.bool]: ...
171173
@overload
172174
def __gt__(
173175
self,
@@ -176,7 +178,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
176178
@overload
177179
def __lt__(self, other: Interval[_OrderableT]) -> bool: ...
178180
@overload
179-
def __lt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
181+
def __lt__(
182+
self: IntervalT, other: IntervalIndex[IntervalT]
183+
) -> np_1darray[np.bool]: ...
180184
@overload
181185
def __lt__(
182186
self,
@@ -185,7 +189,9 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
185189
@overload
186190
def __ge__(self, other: Interval[_OrderableT]) -> bool: ...
187191
@overload
188-
def __ge__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
192+
def __ge__(
193+
self: IntervalT, other: IntervalIndex[IntervalT]
194+
) -> np_1darray[np.bool]: ...
189195
@overload
190196
def __ge__(
191197
self,
@@ -194,19 +200,25 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
194200
@overload
195201
def __le__(self, other: Interval[_OrderableT]) -> bool: ...
196202
@overload
197-
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
203+
def __le__(
204+
self: IntervalT, other: IntervalIndex[IntervalT]
205+
) -> np_1darray[np.bool]: ...
198206
@overload
199207
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
200208
@overload
201-
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
209+
def __eq__(
210+
self: IntervalT, other: IntervalIndex[IntervalT]
211+
) -> np_1darray[np.bool]: ...
202212
@overload
203213
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
204214
@overload
205215
def __eq__(self, other: object) -> Literal[False]: ...
206216
@overload
207217
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
208218
@overload
209-
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_ndarray_bool: ...
219+
def __ne__(
220+
self: IntervalT, other: IntervalIndex[IntervalT]
221+
) -> np_1darray[np.bool]: ...
210222
@overload
211223
def __ne__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
212224
@overload

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class ApplyTypeError(TypeError): ...
2929
class BaseOffset:
3030
n: int
3131
def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...
32-
def __eq__(self, other) -> bool: ...
33-
def __ne__(self, other) -> bool: ...
32+
def __eq__(self, other: object) -> bool: ...
33+
def __ne__(self, other: object) -> bool: ...
3434
def __hash__(self) -> int: ...
3535
@property
36-
def kwds(self) -> dict: ...
36+
def kwds(self) -> dict[str, Any]: ...
3737
@property
3838
def base(self) -> BaseOffset: ...
3939
@overload
@@ -67,7 +67,6 @@ class BaseOffset:
6767
def __rsub__(self, other: BaseOffset) -> Self: ...
6868
@overload
6969
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
70-
def __call__(self, other): ...
7170
@overload
7271
def __mul__(self, other: np.ndarray) -> np.ndarray: ...
7372
@overload
@@ -87,8 +86,6 @@ class BaseOffset:
8786
def rollback(self, dt: datetime) -> datetime: ...
8887
def rollforward(self, dt: datetime) -> datetime: ...
8988
def is_on_offset(self, dt: datetime) -> bool: ...
90-
def __setstate__(self, state) -> None: ...
91-
def __getstate__(self): ...
9289
@property
9390
def nanos(self) -> int: ...
9491

pandas-stubs/_libs/tslibs/period.pyi

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ from typing_extensions import TypeAlias
2222
from pandas._libs.tslibs import NaTType
2323
from pandas._libs.tslibs.offsets import BaseOffset
2424
from pandas._libs.tslibs.timestamps import Timestamp
25-
from pandas._typing import npt
25+
from pandas._typing import (
26+
ShapeT,
27+
np_1darray,
28+
np_ndarray,
29+
)
2630

2731
class IncompatibleFrequency(ValueError): ...
2832

@@ -98,44 +102,64 @@ class Period(PeriodMixin):
98102
@overload
99103
def __eq__(self, other: Period) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
100104
@overload
101-
def __eq__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[overload-overlap]
105+
def __eq__(self, other: PeriodIndex) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
102106
@overload
103107
def __eq__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
104108
@overload
109+
def __eq__(self, other: np_ndarray[ShapeT, np.object_]) -> np_ndarray[ShapeT, np.bool]: ... # type: ignore[overload-overlap]
110+
@overload
105111
def __eq__(self, other: object) -> Literal[False]: ...
106112
@overload
107113
def __ge__(self, other: Period) -> bool: ...
108114
@overload
109-
def __ge__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ...
115+
def __ge__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
110116
@overload
111117
def __ge__(self, other: PeriodSeries) -> Series[bool]: ...
112118
@overload
119+
def __ge__(
120+
self, other: np_ndarray[ShapeT, np.object_]
121+
) -> np_ndarray[ShapeT, np.bool]: ...
122+
@overload
113123
def __gt__(self, other: Period) -> bool: ...
114124
@overload
115-
def __gt__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ...
125+
def __gt__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
116126
@overload
117127
def __gt__(self, other: PeriodSeries) -> Series[bool]: ...
118128
@overload
129+
def __gt__(
130+
self, other: np_ndarray[ShapeT, np.object_]
131+
) -> np_ndarray[ShapeT, np.bool]: ...
132+
@overload
119133
def __le__(self, other: Period) -> bool: ...
120134
@overload
121-
def __le__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ...
135+
def __le__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
122136
@overload
123137
def __le__(self, other: PeriodSeries) -> Series[bool]: ...
124138
@overload
139+
def __le__(
140+
self, other: np_ndarray[ShapeT, np.object_]
141+
) -> np_ndarray[ShapeT, np.bool]: ...
142+
@overload
125143
def __lt__(self, other: Period) -> bool: ...
126144
@overload
127-
def __lt__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ...
145+
def __lt__(self, other: PeriodIndex) -> np_1darray[np.bool]: ...
128146
@overload
129147
def __lt__(self, other: PeriodSeries) -> Series[bool]: ...
148+
@overload
149+
def __lt__(
150+
self, other: np_ndarray[ShapeT, np.object_]
151+
) -> np_ndarray[ShapeT, np.bool]: ...
130152
# ignore[misc] here because we know all other comparisons
131153
# are False, so we use Literal[False]
132154
@overload
133155
def __ne__(self, other: Period) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
134156
@overload
135-
def __ne__(self, other: PeriodIndex) -> npt.NDArray[np.bool_]: ... # type: ignore[overload-overlap]
157+
def __ne__(self, other: PeriodIndex) -> np_1darray[np.bool]: ... # type: ignore[overload-overlap]
136158
@overload
137159
def __ne__(self, other: PeriodSeries) -> Series[bool]: ... # type: ignore[overload-overlap]
138160
@overload
161+
def __ne__(self, other: np_ndarray[ShapeT, np.object_]) -> np_ndarray[ShapeT, np.bool]: ... # type: ignore[overload-overlap]
162+
@overload
139163
def __ne__(self, other: object) -> Literal[True]: ...
140164
# Ignored due to indecipherable error from mypy:
141165
# Forward operator "__add__" is not callable [misc]

0 commit comments

Comments
 (0)