Skip to content

Commit

Permalink
Add missing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Nov 14, 2024
1 parent 2304e71 commit 045bddb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2741,7 +2741,13 @@ def maybe_convert_objects(ndarray[object] objects,
seen.object_ = True

elif seen.str_:
if using_string_dtype() and is_string_array(objects, skipna=True):
if convert_to_nullable_dtype and is_string_array(objects, skipna=True):
from pandas.core.arrays.string_ import StringDtype

dtype = StringDtype()
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)

elif using_string_dtype() and is_string_array(objects, skipna=True):
from pandas.core.arrays.string_ import StringDtype

dtype = StringDtype(na_value=np.nan)
Expand Down

0 comments on commit 045bddb

Please sign in to comment.