Skip to content

TST: fix xfailing indexing test #37562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2020
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
3 changes: 3 additions & 0 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,9 @@ def _setitem_with_indexer_split_path(self, indexer, value):
self._setitem_single_column(loc, v, plane_indexer)
else:

if isinstance(indexer[0], np.ndarray) and indexer[0].ndim > 2:
raise ValueError(r"Cannot set values with ndim > 2")

# scalar value
for loc in ilocs:
self._setitem_single_column(loc, value, plane_indexer)
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def test_setitem_ndarray_3d(self, index, obj, idxr, idxr_id):
with pytest.raises(err, match=msg):
idxr[nd3] = 0

@pytest.mark.xfail(reason="gh-32896")
def test_setitem_ndarray_3d_does_not_fail_for_iloc_empty_dataframe(self):
# when fixing this, please remove the pytest.skip in test_setitem_ndarray_3d
i = Index([])
Expand Down