File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ import warnings
1010
1111from pandas.util._exceptions import find_stack_level
1212
13- from pandas import StringDtype
13+ from pandas import (
14+ ArrowDtype,
15+ StringDtype,
16+ )
1417from pandas.core.arrays import (
1518 ArrowExtensionArray,
1619 BooleanArray,
@@ -43,7 +46,6 @@ from libc.string cimport (
4346 strncpy,
4447)
4548
46-
4749import numpy as np
4850
4951cimport numpy as cnp
@@ -1452,7 +1454,13 @@ def _maybe_upcast(
14521454
14531455 elif arr.dtype == np.object_:
14541456 if use_dtype_backend:
1455- dtype = StringDtype()
1457+ if dtype_backend == " pyarrow" :
1458+ # using the StringDtype below would use large_string by default
1459+ # keep here to pyarrow's default of string
1460+ import pyarrow as pa
1461+ dtype = ArrowDtype(pa.string())
1462+ else :
1463+ dtype = StringDtype()
14561464 cls = dtype.construct_array_type()
14571465 arr = cls ._from_sequence(arr, dtype = dtype)
14581466
You can’t perform that action at this time.
0 commit comments