Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ def _box_pa_array(
-------
pa.Array or pa.ChunkedArray
"""
value = extract_array(value, extract_numpy=True)
if isinstance(value, cls):
pa_array = value._pa_array
elif isinstance(value, (pa.Array, pa.ChunkedArray)):
Expand Down
13 changes: 13 additions & 0 deletions pandas/tests/indexing/test_iloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from pandas.compat import pa_version_under16p0
from pandas.errors import IndexingError
import pandas.util._test_decorators as td

from pandas import (
NA,
Expand Down Expand Up @@ -1535,3 +1536,15 @@ def test_iloc_arrow_extension_array(self):
expected = df.iloc[:, df["c"]]
result = df_arrow.iloc[:, df_arrow["c"]]
tm.assert_frame_equal(result, expected, check_dtype=False)

@td.skip_if_no("pyarrow")
def test_setitem_pyarrow_int_series(self):
# GH#62462
ser = Series([1, 2, 3], dtype="int64[pyarrow]")
idx = Index([0, 1])
vals = Series([7, 8], dtype="int64[pyarrow]")

ser.iloc[idx] = vals

expected = Series([7, 8, 3], dtype="int64[pyarrow]")
tm.assert_series_equal(ser, expected)
Loading