diff --git a/pandas/core/frame.py b/pandas/core/frame.py index d3116f83d58cb..84d45b9e105c2 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8255,7 +8255,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 a35530100a425..2903436337820 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)