Skip to content

Commit 045bddb

Browse files
committed
Add missing logic
1 parent 2304e71 commit 045bddb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/_libs/lib.pyx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2741,7 +2741,13 @@ def maybe_convert_objects(ndarray[object] objects,
27412741
seen.object_ = True
27422742

27432743
elif seen.str_:
2744-
if using_string_dtype() and is_string_array(objects, skipna=True):
2744+
if convert_to_nullable_dtype and is_string_array(objects, skipna=True):
2745+
from pandas.core.arrays.string_ import StringDtype
2746+
2747+
dtype = StringDtype()
2748+
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
2749+
2750+
elif using_string_dtype() and is_string_array(objects, skipna=True):
27452751
from pandas.core.arrays.string_ import StringDtype
27462752

27472753
dtype = StringDtype(na_value=np.nan)

0 commit comments

Comments
 (0)