Skip to content

Commit e69265b

Browse files
committed
Check if dtype has been initialized before
1 parent a94023f commit e69265b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/construction.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,11 @@ def sanitize_array(
561561
# Avoid ending up with a NumpyExtensionArray
562562
dtype = dtype.numpy_dtype
563563

564-
elif not pa_version_under10p1 and isinstance(data, (pa.ChunkedArray, pa.Array)):
564+
elif (
565+
not pa_version_under10p1
566+
and isinstance(data, (pa.ChunkedArray, pa.Array))
567+
and dtype is None
568+
):
565569
dtype = ArrowDtype(data.type)
566570

567571
infer_object = not isinstance(data, (ABCIndex, ABCSeries))

0 commit comments

Comments
 (0)