Skip to content

Commit

Permalink
TST: frame.update accepts duplicate frame index with unique argument p…
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliobarbosa committed Feb 26, 2024
1 parent eb963df commit d5a1085
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/frame/methods/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,11 @@ def test_update_raises_on_duplicate_argument_index(self):
other = DataFrame({"a": [2, 3]}, index=[1, 1])
with pytest.raises(ValueError, match="duplicate index"):
df.update(other)

def test_update_on_duplicate_frame_unique_argument_index(self):
# GH#55509
df = DataFrame({"a": [1, 1, 1]}, index=[1, 1, 2])
other = DataFrame({"a": [2, 3]}, index=[1, 2])
expected = DataFrame({"a": [2, 2, 3]}, index=[1, 1, 2])
df.update(other)
tm.assert_frame_equal(df, expected)

0 comments on commit d5a1085

Please sign in to comment.