Skip to content

Commit a48fb73

Browse files
committed
STYLE: remove use in pd.api.dtype in list/array.py (pandas-dev#39203)
1 parent 644c9fb commit a48fb73

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/tests/extension/list/array.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import pandas as pd
1616
from pandas.core.arrays import ExtensionArray
17+
from pandas.api.types import is_string_dtype, is_object_dtype
1718

1819

1920
class ListDtype(ExtensionDtype):
@@ -104,9 +105,7 @@ def astype(self, dtype, copy=True):
104105
if copy:
105106
return self.copy()
106107
return self
107-
elif pd.api.types.is_string_dtype(dtype) and not pd.api.types.is_object_dtype(
108-
dtype
109-
):
108+
elif is_string_dtype(dtype) and not is_object_dtype(dtype):
110109
# numpy has problems with astype(str) for nested elements
111110
return np.array([str(x) for x in self.data], dtype=dtype)
112111
return np.array(self.data, dtype=dtype, copy=copy)

0 commit comments

Comments
 (0)