Skip to content

Commit b1986fc

Browse files
committed
fix the import error
1 parent 7e4e60a commit b1986fc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pandas/core/arrays/string_.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
pa_version_under10p1,
2929
)
3030
from pandas.compat.numpy import function as nv
31-
from pandas.util._decorators import doc
31+
from pandas.util._decorators import (
32+
doc,
33+
set_module,
34+
)
3235
from pandas.util._exceptions import find_stack_level
3336

3437
from pandas.core.dtypes.base import (
@@ -64,7 +67,7 @@
6467
from pandas.core.construction import extract_array
6568
from pandas.core.indexers import check_array_indexer
6669
from pandas.core.missing import isna
67-
from pandas.util._decorators import set_module
70+
6871
from pandas.io.formats import printing
6972

7073
if TYPE_CHECKING:
@@ -374,6 +377,7 @@ def __from_arrow__(
374377
NDArrayBacked.__init__(new_string_array, arr, self)
375378
return new_string_array
376379

380+
377381
@set_module("pandas")
378382
class BaseStringArray(ExtensionArray):
379383
"""
@@ -534,6 +538,7 @@ def _str_map_nan_semantics(
534538
# error: Definition of "_concat_same_type" in base class "NDArrayBacked" is
535539
# incompatible with definition in base class "ExtensionArray"
536540

541+
537542
class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc]
538543
"""
539544
Extension array for string data.
@@ -723,7 +728,8 @@ def __arrow_array__(self, type=None):
723728
values[self.isna()] = None
724729
return pa.array(values, type=type, from_pandas=True)
725730

726-
def _values_for_factorize(self) -> tuple[np.ndarray, libmissing.NAType | float]: # type: ignore[override]
731+
# type: ignore[override]
732+
def _values_for_factorize(self) -> tuple[np.ndarray, libmissing.NAType | float]:
727733
arr = self._ndarray
728734

729735
return arr, self.dtype.na_value
@@ -961,7 +967,6 @@ def _cmp_method(self, other, op):
961967
_arith_method = _cmp_method
962968

963969

964-
965970
class StringArrayNumpySemantics(StringArray):
966971
_storage = "python"
967972
_na_value = np.nan

0 commit comments

Comments
 (0)