Skip to content

Commit 56f8f16

Browse files
committed
Manage string convertible to nullable dtype
1 parent 2d92818 commit 56f8f16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/_libs/lib.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,10 @@ def maybe_convert_objects(ndarray[object] objects,
27942794
dtype = StringDtype(storage="pyarrow", na_value=np.nan)
27952795
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
27962796

2797-
elif storage is None or storage == "python":
2797+
elif (
2798+
(convert_to_nullable_dtype and is_string_array(objects, skipna=True))
2799+
or storage == "python"
2800+
):
27982801
from pandas.core.arrays.string_ import StringDtype
27992802

28002803
dtype = StringDtype(storage=storage)

0 commit comments

Comments
 (0)