Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #49720 on branch 1.5.x (Suppress spurious warning) #49726

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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