Skip to content

Commit

Permalink
Backport PR #49720 on branch 1.5.x (Suppress spurious warning) (#49726)
Browse files Browse the repository at this point in the history
Backport PR #49720: Suppress spurious warning

Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
  • Loading branch information
meeseeksmachine and jbrockmendel committed Nov 16, 2022
1 parent 63a91d0 commit 6f8e174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pandas/core/frame.py
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/frame/methods/test_update.py
Expand Up @@ -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)

Expand Down

0 comments on commit 6f8e174

Please sign in to comment.