Skip to content

Commit eb963df

Browse files
TST: Add a test for frame.update raising on duplicate argument indexes (pandas-dev#55509)
1 parent 93ea131 commit eb963df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/frame/methods/test_update.py

+7
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,10 @@ def test_update_preserve_dtype(self, value_df, value_other, dtype):
213213
expected = DataFrame({"a": [value_other, value_df]}, index=[1, 2])
214214
df.update(other)
215215
tm.assert_frame_equal(df, expected)
216+
217+
def test_update_raises_on_duplicate_argument_index(self):
218+
# GH#55509
219+
df = DataFrame({"a": [1, 1]}, index=[1, 2])
220+
other = DataFrame({"a": [2, 3]}, index=[1, 1])
221+
with pytest.raises(ValueError, match="duplicate index"):
222+
df.update(other)

0 commit comments

Comments
 (0)