Skip to content

Commit 96871c1

Browse files
committed
Replace pyarrow type check by existing lib function
1 parent bd38f15 commit 96871c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/core/construction.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import pandas.core.common as com
5757

5858
if not pa_version_under10p1:
59-
import pyarrow as pa
59+
pass
6060

6161
if TYPE_CHECKING:
6262
from collections.abc import Sequence
@@ -554,11 +554,7 @@ def sanitize_array(
554554
np.ndarray or ExtensionArray
555555
"""
556556
original_dtype = dtype
557-
if (
558-
not pa_version_under10p1
559-
and isinstance(data, (pa.ChunkedArray, pa.Array))
560-
and dtype is None
561-
):
557+
if not pa_version_under10p1 and lib.is_pyarrow_array(data) and dtype is None:
562558
dtype = ArrowDtype(data.type)
563559

564560
if isinstance(data, ma.MaskedArray):

0 commit comments

Comments
 (0)