Skip to content

Commit 7a6a4e1

Browse files
committed
line-based ignores for PYI030
1 parent 6c185dd commit 7a6a4e1

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
--target-version, py38,
2020
--extend-select, "PYI,UP,RUF100",
2121
--ignore, "E501,E731,F841,PYI042",
22-
--per-file-ignores, "_*.pyi:PYI001, _*.pyi:PYI030",
22+
--per-file-ignores, "_*.pyi:PYI001",
2323
--fix
2424
]
2525
- repo: https://github.com/codespell-project/codespell

pandas-stubs/_typing.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DtypeBackend: TypeAlias = Literal["pyarrow", "numpy_nullable"]
9191

9292
BooleanDtypeArg: TypeAlias = (
9393
# Builtin bool type and its string alias
94-
type[bool]
94+
type[bool] # noqa: PYI030
9595
| Literal["bool"]
9696
# Pandas nullable boolean type and its string alias
9797
| pd.BooleanDtype
@@ -105,7 +105,7 @@ BooleanDtypeArg: TypeAlias = (
105105
)
106106
IntDtypeArg: TypeAlias = (
107107
# Builtin integer type and its string alias
108-
type[int]
108+
type[int] # noqa: PYI030
109109
| Literal["int"]
110110
# Pandas nullable integer types and their string aliases
111111
| pd.Int8Dtype
@@ -166,7 +166,7 @@ UIntDtypeArg: TypeAlias = (
166166
)
167167
StrDtypeArg: TypeAlias = (
168168
# Builtin str type and its string alias
169-
type[str]
169+
type[str] # noqa: PYI030
170170
| Literal["str"]
171171
# Pandas nullable string type and its string alias
172172
| pd.StringDtype
@@ -175,7 +175,7 @@ StrDtypeArg: TypeAlias = (
175175
BytesDtypeArg: TypeAlias = type[bytes]
176176
FloatDtypeArg: TypeAlias = (
177177
# Builtin float type and its string alias
178-
type[float]
178+
type[float] # noqa: PYI030
179179
| Literal["float"]
180180
# Pandas nullable float types and their string aliases
181181
| pd.Float32Dtype
@@ -206,7 +206,7 @@ FloatDtypeArg: TypeAlias = (
206206
)
207207
ComplexDtypeArg: TypeAlias = (
208208
# Builtin complex type and its string alias
209-
type[complex]
209+
type[complex] # noqa: PYI030
210210
| Literal["complex"]
211211
# Numpy complex types and their aliases
212212
# https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.csingle

pandas-stubs/core/indexes/accessors.pyi

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ class Properties(PandasDelegate, PandasObject, NoNewAttributesMixin):
4545

4646
_DTFieldOpsReturnType = TypeVar("_DTFieldOpsReturnType", Series[int], _IntIndexType)
4747

48-
class _DatetimeFieldOps(
49-
_DayLikeFieldOps[_DTFieldOpsReturnType], # noqa: F821
50-
_MiniSeconds[_DTFieldOpsReturnType], # noqa: F821
51-
): ...
52-
class PeriodIndexFieldOps(
53-
_DayLikeFieldOps[_IntIndexType], # noqa: F821
54-
_PeriodProperties[ # noqa: F821
55-
DatetimeIndex, _IntIndexType, Index, DatetimeIndex, PeriodIndex
56-
],
57-
): ...
58-
5948
class _DayLikeFieldOps(Generic[_DTFieldOpsReturnType]):
6049
@property
6150
def year(self) -> _DTFieldOpsReturnType: ...
@@ -92,6 +81,10 @@ class _MiniSeconds(Generic[_DTFieldOpsReturnType]):
9281
@property
9382
def nanosecond(self) -> _DTFieldOpsReturnType: ...
9483

84+
class _DatetimeFieldOps(
85+
_DayLikeFieldOps[_DTFieldOpsReturnType], _MiniSeconds[_DTFieldOpsReturnType]
86+
): ...
87+
9588
_DTBoolOpsReturnType = TypeVar("_DTBoolOpsReturnType", Series[bool], np_ndarray_bool)
9689

9790
class _IsLeapYearProperty(Generic[_DTBoolOpsReturnType]):
@@ -341,6 +334,10 @@ class _PeriodProperties(
341334
how: Literal["E", "END", "FINISH", "S", "START", "BEGIN"] = ...,
342335
) -> _PeriodPAReturnTypes: ...
343336

337+
class PeriodIndexFieldOps(
338+
_DayLikeFieldOps[_IntIndexType],
339+
_PeriodProperties[DatetimeIndex, _IntIndexType, Index, DatetimeIndex, PeriodIndex],
340+
): ...
344341
class PeriodProperties(
345342
Properties,
346343
_PeriodProperties[

0 commit comments

Comments
 (0)