We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6222789 commit 50910f9Copy full SHA for 50910f9
pandas/_libs/lib.pyx
@@ -2681,14 +2681,13 @@ def maybe_convert_objects(ndarray[object] objects,
2681
seen.object_ = True
2682
2683
elif seen.str_:
2684
- if is_string_array(objects, skipna=True):
2685
- if using_pyarrow_string_dtype():
2686
- import pyarrow as pa
+ if using_pyarrow_string_dtype() and is_string_array(objects, skipna=True):
+ import pyarrow as pa
2687
2688
- from pandas.core.dtypes.dtypes import ArrowDtype
+ from pandas.core.dtypes.dtypes import ArrowDtype
2689
2690
- dtype = ArrowDtype(pa.string())
2691
- return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
+ dtype = ArrowDtype(pa.string())
+ return dtype.construct_array_type()._from_sequence(objects, dtype=dtype)
2692
2693
2694
elif seen.interval_:
0 commit comments