diff --git a/pandas/core/strings/object_array.py b/pandas/core/strings/object_array.py index ba2f56c79bdfe..2ce5c0cbea272 100644 --- a/pandas/core/strings/object_array.py +++ b/pandas/core/strings/object_array.py @@ -12,7 +12,7 @@ import pandas._libs.missing as libmissing import pandas._libs.ops as libops from pandas._typing import ( - Dtype, + NpDtype, Scalar, ) @@ -37,7 +37,7 @@ def __len__(self): raise NotImplementedError def _str_map( - self, f, na_value=None, dtype: Dtype | None = None, convert: bool = True + self, f, na_value=None, dtype: NpDtype | None = None, convert: bool = True ): """ Map a callable over valid elements of the array. @@ -62,9 +62,7 @@ def _str_map( na_value = self._str_na_value if not len(self): - # error: Argument 1 to "ndarray" has incompatible type "int"; - # expected "Sequence[int]" - return np.ndarray(0, dtype=dtype) # type: ignore[arg-type] + return np.ndarray(0, dtype=dtype) arr = np.asarray(self, dtype=object) mask = isna(arr)