Skip to content

Commit 9312dde

Browse files
authored
PERF: ArrowExtensionArray._from_sequence (#51836)
1 parent add6a4b commit 9312dde

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/core/arrays/arrow/array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
from copy import deepcopy
43
import operator
54
import re
65
from typing import (
@@ -243,7 +242,7 @@ def _from_sequence(cls, scalars, *, dtype: Dtype | None = None, copy: bool = Fal
243242
elif not isinstance(scalars, (pa.Array, pa.ChunkedArray)):
244243
if copy and is_array_like(scalars):
245244
# pa array should not get updated when numpy array is updated
246-
scalars = deepcopy(scalars)
245+
scalars = scalars.copy()
247246
try:
248247
scalars = pa.array(scalars, type=pa_dtype, from_pandas=True)
249248
except pa.ArrowInvalid:

0 commit comments

Comments
 (0)