Skip to content

Commit 6eaf5ef

Browse files
committed
line-based ignores for PYI030
1 parent 5d536e1 commit 6eaf5ef

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
@@ -80,7 +80,7 @@ DtypeArg: TypeAlias = Dtype | Mapping[Any, Dtype]
8080
DtypeBackend: TypeAlias = Literal["pyarrow", "numpy_nullable"]
8181
BooleanDtypeArg: TypeAlias = (
8282
# Builtin bool type and its string alias
83-
type[bool]
83+
type[bool] # noqa: PYI030
8484
| Literal["bool"]
8585
# Pandas nullable boolean type and its string alias
8686
| pd.BooleanDtype
@@ -90,7 +90,7 @@ BooleanDtypeArg: TypeAlias = (
9090
)
9191
IntDtypeArg: TypeAlias = (
9292
# Builtin integer type and its string alias
93-
type[int]
93+
type[int] # noqa: PYI030
9494
| Literal["int"]
9595
# Pandas nullable integer types and their string aliases
9696
| pd.Int8Dtype
@@ -117,7 +117,7 @@ IntDtypeArg: TypeAlias = (
117117
)
118118
StrDtypeArg: TypeAlias = (
119119
# Builtin str type and its string alias
120-
type[str]
120+
type[str] # noqa: PYI030
121121
| Literal["str"]
122122
# Pandas nullable string type and its string alias
123123
| pd.StringDtype
@@ -126,7 +126,7 @@ StrDtypeArg: TypeAlias = (
126126
BytesDtypeArg: TypeAlias = type[bytes]
127127
FloatDtypeArg: TypeAlias = (
128128
# Builtin float type and its string alias
129-
type[float]
129+
type[float] # noqa: PYI030
130130
| Literal["float"]
131131
# Pandas nullable float types and their string aliases
132132
| pd.Float32Dtype
@@ -140,7 +140,7 @@ FloatDtypeArg: TypeAlias = (
140140
)
141141
ComplexDtypeArg: TypeAlias = (
142142
# Builtin complex type and its string alias
143-
type[complex]
143+
type[complex] # noqa: PYI030
144144
| Literal["complex"]
145145
# Numpy complex types and their aliases
146146
| type[np.complex64]

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)