Skip to content

Commit 1f5d9d7

Browse files
authored
type IntervalIndex (pandas-dev#1458)
* type `IntervalIndex` * update pyproject.toml
1 parent 36ea021 commit 1f5d9d7

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

pandas-stubs/core/indexes/interval.pyi

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import datetime as dt
66
from typing import (
77
Literal,
88
TypeAlias,
9-
final,
109
overload,
1110
)
1211

@@ -22,7 +21,6 @@ from pandas._libs.interval import (
2221
from pandas._typing import (
2322
DatetimeLike,
2423
DtypeArg,
25-
FillnaOptions,
2624
Frequency,
2725
IntervalClosedType,
2826
IntervalT,
@@ -219,14 +217,6 @@ class IntervalIndex(ExtensionIndex[IntervalT, np.object_], IntervalMixin):
219217
@property
220218
def is_overlapping(self) -> bool: ...
221219
def get_loc(self, key: Label) -> int | slice | np_1darray[np.bool]: ...
222-
@final
223-
def get_indexer(
224-
self,
225-
target: Index,
226-
method: FillnaOptions | Literal["nearest"] | None = ...,
227-
limit: int | None = ...,
228-
tolerance=...,
229-
) -> np_1darray[np.intp]: ...
230220
def get_indexer_non_unique(
231221
self, target: Index
232222
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...

pandas-stubs/core/indexes/range.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RangeIndex(_IndexSubclassBase[int, np.int64]):
3737
dtype: Dtype | None = None,
3838
copy: bool = False,
3939
name: Hashable | None = None,
40-
): ...
40+
) -> Self: ...
4141
@classmethod
4242
def from_range(
4343
cls, data: range, name: Hashable | None = None, dtype: Dtype | None = None

pyproject.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,16 @@ ignore = [
216216
# TODO: remove when pandas-dev/pandas-stubs#1446 is resolved
217217
"ANN001", "ANN201", "ANN204", "ANN206",
218218
]
219-
"*index*" = [
220-
# TODO: remove when indexes are fully typed
219+
"indexers.pyi" = [
220+
# TODO: remove when indexers.pyi is fully typed
221+
"ANN001", "ANN201", "ANN204", "ANN206",
222+
]
223+
"multi.pyi" = [
224+
# TODO: remove when multi.pyi is fully typed
225+
"ANN001", "ANN201", "ANN204", "ANN206",
226+
]
227+
"indexing.pyi" = [
228+
# TODO: remove when indexing.pyi is fully typed
221229
"ANN001", "ANN201", "ANN204", "ANN206",
222230
]
223231
"*computation*" = [

0 commit comments

Comments
 (0)