diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 9f13471d0aa3f..85222e06502bf 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8082,7 +8082,9 @@ def update( if mask.all(): continue - self.loc[:, col] = expressions.where(mask, this, that) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", "In a future version, `df.iloc") + self.loc[:, col] = expressions.where(mask, this, that) # ---------------------------------------------------------------------- # Data reshaping diff --git a/pandas/tests/frame/methods/test_update.py b/pandas/tests/frame/methods/test_update.py index 40f87f1382625..ef468065f7e0e 100644 --- a/pandas/tests/frame/methods/test_update.py +++ b/pandas/tests/frame/methods/test_update.py @@ -136,7 +136,8 @@ def test_update_from_non_df(self): def test_update_datetime_tz(self): # GH 25807 result = DataFrame([pd.Timestamp("2019", tz="UTC")]) - result.update(result) + with tm.assert_produces_warning(None): + result.update(result) expected = DataFrame([pd.Timestamp("2019", tz="UTC")]) tm.assert_frame_equal(result, expected)