Skip to content

Commit 2571e54

Browse files
committed
Ensure "string[pyarrow]" type is preserved when calling extractall
1 parent 10cf330 commit 2571e54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/strings/accessor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3448,8 +3448,9 @@ def _result_dtype(arr):
34483448
# ideally we just pass `dtype=arr.dtype` unconditionally, but this fails
34493449
# when the list of values is empty.
34503450
from pandas.core.arrays.string_ import StringDtype
3451+
from pandas.core.dtypes.dtypes import ArrowDtype
34513452

3452-
if isinstance(arr.dtype, StringDtype):
3453+
if isinstance(arr.dtype, StringDtype) or isinstance(arr.dtype, ArrowDtype):
34533454
return arr.dtype
34543455
else:
34553456
return object

0 commit comments

Comments
 (0)