diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a7535835f4b84..859a18e48b9d1 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -10082,11 +10082,7 @@ def update( index_intersection = other.index.intersection(self.index) if index_intersection.empty: - raise ValueError( - "Update not allowed when the index on `other` has no intersection " - "with this dataframe." - ) - + return other = other.reindex(index_intersection) this_data = self.loc[index_intersection] diff --git a/pandas/tests/frame/methods/test_update.py b/pandas/tests/frame/methods/test_update.py index 81b25c0ad982e..0987745c94a21 100644 --- a/pandas/tests/frame/methods/test_update.py +++ b/pandas/tests/frame/methods/test_update.py @@ -215,12 +215,13 @@ def test_update_raises_on_duplicate_argument_index(self): with pytest.raises(ValueError, match="duplicate index"): df.update(other) - def test_update_raises_without_intersection(self): - # GH#55509 - df = DataFrame({"a": [1]}, index=[1]) + def test_update_without_intersection(self): + # GH#63452 + orig = DataFrame({"a": [1]}, index=[1]) + df = orig.copy() other = DataFrame({"a": [2]}, index=[2]) - with pytest.raises(ValueError, match="no intersection"): - df.update(other) + df.update(other) + tm.assert_frame_equal(df, orig) def test_update_on_duplicate_frame_unique_argument_index(self): # GH#55509