Skip to content

Commit bb01589

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

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/strings/accessor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,10 +3449,9 @@ def _result_dtype(arr):
34493449
# when the list of values is empty.
34503450
from pandas.core.arrays.string_ import StringDtype
34513451

3452-
if isinstance(arr.dtype, StringDtype):
3452+
if isinstance(arr.dtype, (ArrowDtype, StringDtype)):
34533453
return arr.dtype
3454-
else:
3455-
return object
3454+
return object
34563455

34573456

34583457
def _get_single_group_name(regex: re.Pattern) -> Hashable:

0 commit comments

Comments
 (0)