Skip to content

Commit 563cf3f

Browse files
kkleinim-vinicius
authored and
im-vinicius
committed
TYP: Narrow down type of method keyword in Index (pandas-dev#52723)
* Add literal type hint. * Move type variable to _typing.py. * Use existing type alias. * EOF
1 parent 2960dfa commit 563cf3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/indexes/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
JoinHow,
5757
Level,
5858
NaPosition,
59+
ReindexMethod,
5960
Self,
6061
Shape,
6162
npt,
@@ -208,7 +209,6 @@
208209
_index_shared_docs: dict[str, str] = {}
209210
str_t = str
210211

211-
212212
_dtype_obj = np.dtype("object")
213213

214214
_masked_engines = {
@@ -3755,7 +3755,7 @@ def get_loc(self, key):
37553755
def get_indexer(
37563756
self,
37573757
target,
3758-
method: str_t | None = None,
3758+
method: ReindexMethod | None = None,
37593759
limit: int | None = None,
37603760
tolerance=None,
37613761
) -> npt.NDArray[np.intp]:
@@ -4208,7 +4208,7 @@ def _validate_can_reindex(self, indexer: np.ndarray) -> None:
42084208
def reindex(
42094209
self,
42104210
target,
4211-
method=None,
4211+
method: ReindexMethod | None = None,
42124212
level=None,
42134213
limit: int | None = None,
42144214
tolerance: float | None = None,

0 commit comments

Comments
 (0)