Skip to content

Commit 47c7af8

Browse files
committed
Implement SetItem tests
1 parent 4cef00b commit 47c7af8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pandas/core/arrays/list_.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ def __getitem__(self, item):
207207

208208
return type(self)(self._pa_array[item])
209209

210+
def __setitem__(self, key, value) -> None:
211+
msg = "ListArray does not support item assignment via setitem"
212+
raise TypeError(msg)
213+
210214
@classmethod
211215
def _empty(cls, shape: Shape, dtype: ExtensionDtype):
212216
"""

pandas/tests/extension/list/test_list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from pandas.tests.extension.base.printing import BasePrintingTests
3333
from pandas.tests.extension.base.reduce import BaseReduceTests
3434
from pandas.tests.extension.base.reshaping import BaseReshapingTests
35+
from pandas.tests.extension.base.setitem import BaseSetitemTests
3536

3637
# TODO(wayd): This is copied from string tests - is it required here?
3738
# @pytest.fixture(params=[True, False])
@@ -86,7 +87,7 @@ class TestListArray(
8687
BasePrintingTests,
8788
BaseReduceTests,
8889
BaseReshapingTests,
89-
# BaseSetitemTests,
90+
BaseSetitemTests,
9091
Dim2CompatTests,
9192
):
9293
# TODO(wayd): The tests here are copied from test_arrow.py

0 commit comments

Comments
 (0)