Skip to content

Commit 68ac391

Browse files
Merge remote-tracking branch 'upstream/master' into arrow-string-array-dtype
2 parents 7425536 + 5c64037 commit 68ac391

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/extension/json/array.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
ExtensionDtype,
4040
)
4141
from pandas.api.types import is_bool_dtype
42+
from pandas.core.arrays.string_arrow import ArrowStringDtype
4243

4344

4445
class JSONDtype(ExtensionDtype):
@@ -194,7 +195,7 @@ def astype(self, dtype, copy=True):
194195
if copy:
195196
return self.copy()
196197
return self
197-
elif isinstance(dtype, StringDtype):
198+
elif isinstance(dtype, (StringDtype, ArrowStringDtype)):
198199
value = self.astype(str) # numpy doesn'y like nested dicts
199200
return dtype.construct_array_type()._from_sequence(value, copy=False)
200201

0 commit comments

Comments
 (0)