Skip to content

Commit d5a1085

Browse files
TST: frame.update accepts duplicate frame index with unique argument pandas-dev#55509
1 parent eb963df commit d5a1085

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/frame/methods/test_update.py

+8
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,11 @@ def test_update_raises_on_duplicate_argument_index(self):
220220
other = DataFrame({"a": [2, 3]}, index=[1, 1])
221221
with pytest.raises(ValueError, match="duplicate index"):
222222
df.update(other)
223+
224+
def test_update_on_duplicate_frame_unique_argument_index(self):
225+
# GH#55509
226+
df = DataFrame({"a": [1, 1, 1]}, index=[1, 1, 2])
227+
other = DataFrame({"a": [2, 3]}, index=[1, 2])
228+
expected = DataFrame({"a": [2, 2, 3]}, index=[1, 1, 2])
229+
df.update(other)
230+
tm.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)