Skip to content

Commit cbe97dd

Browse files
committed
ANN206 for pyi
1 parent e00822b commit cbe97dd

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

pandas-stubs/core/arrays/interval.pyi

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ from typing import (
55
)
66

77
import numpy as np
8-
from pandas import (
9-
Index,
10-
Series,
11-
)
128
from pandas.core.arrays.base import ExtensionArray as ExtensionArray
9+
from pandas.core.indexes.base import Index
10+
from pandas.core.series import Series
1311
from typing_extensions import Self
1412

1513
from pandas._libs.interval import (
@@ -32,15 +30,15 @@ class IntervalArray(IntervalMixin, ExtensionArray):
3230
can_hold_na: bool = ...
3331
def __new__(
3432
cls, data, closed=..., dtype=..., copy: bool = ..., verify_integrity: bool = ...
35-
): ...
33+
) -> Self: ...
3634
@classmethod
3735
def from_breaks(
3836
cls,
3937
breaks,
4038
closed: str = "right",
4139
copy: bool = False,
4240
dtype=None,
43-
): ...
41+
) -> Self: ...
4442
@classmethod
4543
def from_arrays(
4644
cls,
@@ -49,15 +47,15 @@ class IntervalArray(IntervalMixin, ExtensionArray):
4947
closed: str = "right",
5048
copy: bool = False,
5149
dtype=...,
52-
): ...
50+
) -> Self: ...
5351
@classmethod
5452
def from_tuples(
5553
cls,
5654
data,
5755
closed: str = "right",
5856
copy: bool = False,
5957
dtype=None,
60-
): ...
58+
) -> Self: ...
6159
def __array__(
6260
self, dtype: NpDtype | None = None, copy: bool | None = None
6361
) -> np_1darray: ...

pandas-stubs/core/arrays/sparse/accessor.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from pandas import Series
21
from pandas.core.accessor import PandasDelegate
2+
from pandas.core.series import Series
3+
from typing_extensions import Self
34

45
class BaseAccessor:
56
def __init__(self, data=...) -> None: ...
@@ -12,7 +13,7 @@ class SparseAccessor(BaseAccessor, PandasDelegate):
1213

1314
class SparseFrameAccessor(BaseAccessor, PandasDelegate):
1415
@classmethod
15-
def from_spmatrix(cls, data, index=..., columns=...): ...
16+
def from_spmatrix(cls, data, index=..., columns=...) -> Self: ...
1617
def to_dense(self): ...
1718
def to_coo(self): ...
1819
@property

pandas-stubs/core/arrays/sparse/array.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SparseArray(ExtensionArray, ExtensionOpsMixin):
3333
copy: bool = ...,
3434
) -> None: ...
3535
@classmethod
36-
def from_spmatrix(cls, data): ...
36+
def from_spmatrix(cls, data) -> Self: ...
3737
def __array__(
3838
self, dtype: NpDtype | None = None, copy: bool | None = None
3939
) -> np_1darray: ...

pandas-stubs/core/indexes/range.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ from pandas.core.indexes.base import (
1313
Index,
1414
_IndexSubclassBase,
1515
)
16+
from typing_extensions import Self
1617

1718
from pandas._typing import (
1819
HashableT,
@@ -32,7 +33,7 @@ class RangeIndex(_IndexSubclassBase[int, np.int64]):
3233
name: Hashable = ...,
3334
): ...
3435
@classmethod
35-
def from_range(cls, data, name: Hashable = ..., dtype=...): ...
36+
def from_range(cls, data, name: Hashable = ..., dtype=...) -> Self: ...
3637
def __reduce__(self): ...
3738
@property
3839
def start(self) -> int: ...

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ ignore = [
201201
"A004", # https://docs.astral.sh/ruff/rules/builtin-import-shadowing/
202202
"PYI001", # https://docs.astral.sh/ruff/rules/unprefixed-type-param/
203203
"PYI042", # https://docs.astral.sh/ruff/rules/snake-case-type-alias/
204-
"ERA001", "ANN001", "ANN201", "ANN204", "ANN206", "PLR0402", "PLC0105"
204+
"ERA001", "ANN001", "ANN201", "ANN204", "PLR0402", "PLC0105"
205205
]
206206
"scripts/*" = [
207207
# The following rules are ignored permanently for good reasons

0 commit comments

Comments
 (0)