Skip to content

Commit c10a244

Browse files
committed
code clean up
1 parent 25a9d35 commit c10a244

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/_libs/lib.pyx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2773,17 +2773,18 @@ def maybe_convert_objects(ndarray[object] objects,
27732773
seen.object_ = True
27742774

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

2779-
dtype = StringDtype(na_value=np.nan)
2779+
dtype = StringDtype()
27802780
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
27812781

2782-
elif convert_to_nullable_dtype and is_string_array(objects, skipna=True):
2782+
elif using_string_dtype() and is_string_array(objects, skipna=True):
27832783
from pandas.core.arrays.string_ import StringDtype
27842784

2785-
dtype = StringDtype()
2785+
dtype = StringDtype(na_value=np.nan)
27862786
return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
2787+
27872788
elif storage == "python":
27882789
from pandas.core.arrays.string_ import StringDtype
27892790

0 commit comments

Comments
 (0)