Skip to content

Commit 05c2540

Browse files
committed
formatting
1 parent 5834dd0 commit 05c2540

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/core/arrays/arrow/accessors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ def __getitem__(self, key: int | slice) -> Series:
165165
# key = pc.add(key, pc.list_value_length(self._pa_array))
166166
element = pc.list_element(self._pa_array, key)
167167
return Series(
168-
element, dtype=ArrowDtype(element.type), index=self._data.index
168+
element,
169+
dtype=ArrowDtype(element.type),
170+
index=self._data.index,
171+
name=self._data.name,
169172
)
170173
elif isinstance(key, slice):
171174
if pa_version_under11p0:

pandas/tests/series/accessors/test_list_accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_list_getitem(list_dtype):
2828
name="a",
2929
)
3030
actual = ser.list[1]
31-
expected = Series([2, None, None], dtype="int64[pyarrow]")
31+
expected = Series([2, None, None], dtype="int64[pyarrow]", name="a")
3232
tm.assert_series_equal(actual, expected)
3333

3434

0 commit comments

Comments
 (0)