Skip to content

Commit 0629fcf

Browse files
committed
More type fixes
1 parent 7e116ef commit 0629fcf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/core/arrays/string_.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
)
2424
from pandas._libs.arrays import NDArrayBacked
2525
from pandas._libs.lib import ensure_string_array
26+
from pandas._typing import npt
2627
from pandas.compat import (
2728
HAS_PYARROW,
2829
pa_version_under10p1,
@@ -83,7 +84,6 @@
8384
NumpyValueArrayLike,
8485
Scalar,
8586
Self,
86-
npt,
8787
type_t,
8888
)
8989

@@ -914,7 +914,7 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra
914914
}[name]
915915

916916
if self._hasna:
917-
na_mask = isna(ndarray)
917+
na_mask = cast(npt.NDArray[np.bool_], isna(ndarray))
918918
if np.all(na_mask):
919919
return type(self)(ndarray)
920920
if skipna:
@@ -941,7 +941,8 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra
941941
tail[:] = np.nan
942942
ndarray = ndarray[:idx]
943943

944-
np_result = np_func(ndarray)
944+
# mypy: Cannot call function of unknown type
945+
np_result = np_func(ndarray) # type: ignore[operator]
945946

946947
if tail is not None:
947948
np_result = np.hstack((np_result, tail))

0 commit comments

Comments
 (0)