File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -554,20 +554,20 @@ def sanitize_array(
554
554
np.ndarray or ExtensionArray
555
555
"""
556
556
original_dtype = dtype
557
+ if (
558
+ not pa_version_under10p1
559
+ and isinstance (data , (pa .ChunkedArray , pa .Array ))
560
+ and dtype is None
561
+ ):
562
+ dtype = ArrowDtype (data .type )
563
+
557
564
if isinstance (data , ma .MaskedArray ):
558
565
data = sanitize_masked_array (data )
559
566
560
567
if isinstance (dtype , NumpyEADtype ):
561
568
# Avoid ending up with a NumpyExtensionArray
562
569
dtype = dtype .numpy_dtype
563
570
564
- elif (
565
- not pa_version_under10p1
566
- and isinstance (data , (pa .ChunkedArray , pa .Array ))
567
- and dtype is None
568
- ):
569
- dtype = ArrowDtype (data .type )
570
-
571
571
infer_object = not isinstance (data , (ABCIndex , ABCSeries ))
572
572
573
573
# extract ndarray or ExtensionArray, ensure we have no NumpyExtensionArray
You can’t perform that action at this time.
0 commit comments