Skip to content

Commit

Permalink
TST: Add a test for frame.update raising on duplicate argument indexes (
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliobarbosa committed Feb 26, 2024
1 parent 93ea131 commit eb963df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas/tests/frame/methods/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,10 @@ def test_update_preserve_dtype(self, value_df, value_other, dtype):
expected = DataFrame({"a": [value_other, value_df]}, index=[1, 2])
df.update(other)
tm.assert_frame_equal(df, expected)

def test_update_raises_on_duplicate_argument_index(self):
# GH#55509
df = DataFrame({"a": [1, 1]}, index=[1, 2])
other = DataFrame({"a": [2, 3]}, index=[1, 1])
with pytest.raises(ValueError, match="duplicate index"):
df.update(other)

0 comments on commit eb963df

Please sign in to comment.