Skip to content

Commit 6410ee6

Browse files
committed
fix(comment): #983 use np_ndarray_bool from pandas._typing in stubs @Dr-Irv #990 (review)
1 parent 9c58445 commit 6410ee6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pandas-stubs/core/indexes/base.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ from typing import (
1818
)
1919

2020
import numpy as np
21-
from numpy import typing as npt
2221
from pandas import (
2322
DataFrame,
2423
DatetimeIndex,
@@ -261,7 +260,7 @@ class Index(IndexOpsMixin[S1]):
261260
**kwargs,
262261
) -> Self: ...
263262
@property
264-
def str(self) -> StringMethods[Self, MultiIndex, npt.NDArray[np.bool_]]: ...
263+
def str(self) -> StringMethods[Self, MultiIndex, np_ndarray_bool]: ...
265264
def is_(self, other) -> bool: ...
266265
def __len__(self) -> int: ...
267266
def __array__(self, dtype=...) -> np.ndarray: ...

pandas-stubs/core/strings.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ from typing import (
1212
)
1313

1414
import numpy as np
15-
from numpy import typing as npt
1615
import pandas as pd
1716
from pandas import (
1817
DataFrame,
@@ -24,12 +23,13 @@ from pandas.core.base import NoNewAttributesMixin
2423
from pandas._typing import (
2524
JoinHow,
2625
T,
26+
np_ndarray_bool,
2727
)
2828

2929
# The _TS type is what is used for the result of str.split with expand=True
3030
_TS = TypeVar("_TS", DataFrame, MultiIndex)
3131
# The _TM type is what is used for the result of str.match
32-
_TM = TypeVar("_TM", Series[bool], npt.NDArray[np.bool_])
32+
_TM = TypeVar("_TM", Series[bool], np_ndarray_bool)
3333

3434
class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM]):
3535
def __init__(self, data: T) -> None: ...

0 commit comments

Comments
 (0)