Skip to content

Commit 188c4d9

Browse files
committed
test
1 parent c9c713d commit 188c4d9

File tree

23 files changed

+213
-240
lines changed

23 files changed

+213
-240
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
timeout-minutes: 10
99
strategy:
10+
fail-fast: false
1011
matrix:
1112
os: [ubuntu-latest, windows-latest, macos-latest]
1213
python-version: ['3.8', '3.9', '3.10']

pandas-stubs/_libs/missing.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NAType:
3434
def __invert__(self, other) -> NAType: ...
3535
def __pow__(self, other) -> NAType: ...
3636
def __rpow__(self, other) -> NAType: ...
37-
def __and__(self, other) -> None | NAType: ...
37+
def __and__(self, other) -> NAType | None: ...
3838
__rand__ = __and__
3939
def __or__(self, other) -> bool | NAType: ...
4040
__ror__ = __or__

pandas-stubs/_libs/tslibs/offsets.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class _CustomBusinessMonth(BusinessMixin):
204204
n: int = ...,
205205
normalize: bool = ...,
206206
offset: timedelta = ...,
207-
holidays: None | list = ...,
207+
holidays: list | None = ...,
208208
): ...
209209

210210
class CustomBusinessDay(BusinessDay):
@@ -224,7 +224,7 @@ class CustomBusinessHour(BusinessHour):
224224
start: str = ...,
225225
end: str = ...,
226226
offset: timedelta = ...,
227-
holidays: None | list = ...,
227+
holidays: list | None = ...,
228228
): ...
229229

230230
class CustomBusinessMonthEnd(_CustomBusinessMonth): ...

pandas-stubs/_libs/tslibs/timedeltas.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class Timedelta(timedelta):
131131
@overload
132132
def __rfloordiv__(self, other: timedelta | str) -> int: ...
133133
@overload
134-
def __rfloordiv__(self, other: None | NaTType) -> NaTType: ...
134+
def __rfloordiv__(self, other: NaTType | None) -> NaTType: ...
135135
@overload
136136
def __rfloordiv__(self, other: np.ndarray) -> npt.NDArray[np.timedelta64]: ...
137137
@overload

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class Timestamp(datetime):
4242
| _date
4343
| datetime
4444
| np.datetime64 = ...,
45-
freq: int | None | str | BaseOffset = ...,
46-
tz: str | _tzinfo | None | int = ...,
45+
freq: int | str | BaseOffset | None = ...,
46+
tz: str | _tzinfo | int | None = ...,
4747
unit: str | int | None = ...,
4848
year: int | None = ...,
4949
month: int | None = ...,

pandas-stubs/_typing.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ from typing import (
2525
)
2626

2727
import numpy as np
28-
from numpy import typing as npt
28+
import numpy.typing
2929
from pandas.core.arrays import ExtensionArray
3030
from pandas.core.frame import DataFrame
3131
from pandas.core.generic import NDFrame
@@ -40,6 +40,9 @@ from pandas._libs.tslibs import (
4040

4141
from pandas.core.dtypes.dtypes import ExtensionDtype
4242

43+
# to re-export npt
44+
npt = numpy.typing
45+
4346
ArrayLike = Union[ExtensionArray, np.ndarray]
4447
AnyArrayLike = Union[Index, Series, np.ndarray]
4548
PythonScalar = Union[str, int, float, bool, complex]
@@ -203,6 +206,6 @@ XMLParsers = Literal["lxml", "etree"]
203206
# Any plain Python or numpy function
204207
Function = Union[np.ufunc, Callable[..., Any]]
205208
GroupByObjectNonScalar = Union[
206-
list[Label], Function, Series, np.ndarray, Mapping[Label, Any], Index
209+
tuple, list[Label], Function, Series, np.ndarray, Mapping[Label, Any], Index
207210
]
208211
GroupByObject = Union[Scalar, GroupByObjectNonScalar]

pandas-stubs/core/arrays/boolean.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype
88

99
from .masked import BaseMaskedArray as BaseMaskedArray
1010

11+
_type = type
1112
_type_BooleanArray = type[BooleanArray]
1213

1314
class BooleanDtype(ExtensionDtype):
1415
name: str = ...
1516
@property
1617
def na_value(self) -> Scalar: ...
1718
@property
18-
def type(self) -> type: ...
19+
def type(self) -> _type: ...
1920
@property
2021
def kind(self) -> str: ...
2122
@classmethod

pandas-stubs/core/arrays/categorical.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ class Categorical(ExtensionArray, PandasObject):
7171
@overload
7272
def set_ordered(self, value, inplace: Literal[False]) -> Categorical: ...
7373
@overload
74-
def set_ordered(self, value, inplace: bool) -> None | Categorical: ...
74+
def set_ordered(self, value, inplace: bool) -> Categorical | None: ...
7575
@overload
7676
def as_ordered(self, inplace: Literal[True]) -> None: ...
7777
@overload
7878
def as_ordered(self, inplace: Literal[False]) -> Categorical: ...
7979
@overload
80-
def as_ordered(self, inplace: bool) -> None | Categorical: ...
80+
def as_ordered(self, inplace: bool) -> Categorical | None: ...
8181
@overload
8282
def as_unordered(self, inplace: Literal[True]) -> None: ...
8383
@overload
@@ -97,7 +97,7 @@ class Categorical(ExtensionArray, PandasObject):
9797
@overload
9898
def set_categories(
9999
self, new_categories, ordered=..., rename: bool = ..., inplace: bool = ...
100-
) -> None | Categorical: ...
100+
) -> Categorical | None: ...
101101
@overload
102102
def rename_categories(self, new_categories, inplace: Literal[True]) -> None: ...
103103
@overload
@@ -107,7 +107,7 @@ class Categorical(ExtensionArray, PandasObject):
107107
@overload
108108
def rename_categories(
109109
self, new_categories, inplace: bool = ...
110-
) -> None | Categorical: ...
110+
) -> Categorical | None: ...
111111
@overload
112112
def reorder_categories(
113113
self, new_categories, ordered=..., *, inplace: Literal[True]
@@ -119,7 +119,7 @@ class Categorical(ExtensionArray, PandasObject):
119119
@overload
120120
def reorder_categories(
121121
self, new_categories, ordered=..., inplace: bool = ...
122-
) -> None | Categorical: ...
122+
) -> Categorical | None: ...
123123
@overload
124124
def add_categories(self, new_categories, inplace: Literal[True]) -> None: ...
125125
@overload
@@ -129,7 +129,7 @@ class Categorical(ExtensionArray, PandasObject):
129129
@overload
130130
def add_categories(
131131
self, new_categories, inplace: bool = ...
132-
) -> None | Categorical: ...
132+
) -> Categorical | None: ...
133133
@overload
134134
def remove_categories(self, removals, inplace: Literal[True]) -> None: ...
135135
@overload
@@ -139,15 +139,15 @@ class Categorical(ExtensionArray, PandasObject):
139139
@overload
140140
def remove_categories(
141141
self, removals, inplace: bool = ...
142-
) -> None | Categorical: ...
142+
) -> Categorical | None: ...
143143
@overload
144144
def remove_unused_categories(self, inplace: Literal[True]) -> None: ...
145145
@overload
146146
def remove_unused_categories(
147147
self, inplace: Literal[False] = ...
148148
) -> Categorical: ...
149149
@overload
150-
def remove_unused_categories(self, inplace: bool = ...) -> None | Categorical: ...
150+
def remove_unused_categories(self, inplace: bool = ...) -> Categorical | None: ...
151151
def map(self, mapper): ...
152152
def __eq__(self, other) -> bool: ...
153153
def __ne__(self, other) -> bool: ...
@@ -202,7 +202,7 @@ class Categorical(ExtensionArray, PandasObject):
202202
@overload
203203
def replace(self, to_replace, value, inplace: Literal[False]) -> Categorical: ...
204204
@overload
205-
def replace(self, to_replace, value, inplace: bool = ...) -> None | Categorical: ...
205+
def replace(self, to_replace, value, inplace: bool = ...) -> Categorical | None: ...
206206

207207
class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):
208208
def __init__(self, data) -> None: ...

pandas-stubs/core/arrays/integer.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype
44

55
from .masked import BaseMaskedArray as BaseMaskedArray
66

7+
_type = type
8+
79
class _IntegerDtype(ExtensionDtype):
810
name: str
911
base = ...
10-
type: type
12+
type: _type
1113
na_value = ...
1214
def is_signed_integer(self): ...
1315
def is_unsigned_integer(self): ...

pandas-stubs/core/arrays/string_.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ from pandas.core.arrays import PandasArray as PandasArray
44

55
from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype
66

7+
_type = type
78
_type_StringArray = type[StringArray]
89

910
class StringDtype(ExtensionDtype):
1011
name: str = ...
1112
na_value = ...
1213
@property
13-
def type(self) -> type: ...
14+
def type(self) -> _type: ...
1415
@classmethod
1516
def construct_array_type(cls) -> _type_StringArray: ...
1617
def __from_arrow__(self, array): ...

pandas-stubs/core/dtypes/base.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from __future__ import annotations
22

33
from pandas.core.arrays import ExtensionArray
44

5+
_type = type
56
_type_ExtensionArray = type[ExtensionArray]
67

78
class ExtensionDtype:
@@ -11,7 +12,7 @@ class ExtensionDtype:
1112
@property
1213
def na_value(self): ...
1314
@property
14-
def type(self) -> type: ...
15+
def type(self) -> _type: ...
1516
@property
1617
def kind(self) -> str: ...
1718
@property

0 commit comments

Comments
 (0)