Skip to content

Commit 3756e4f

Browse files
jbrockmendelmliu08
authored andcommitted
Suppress spurious warning (pandas-dev#49720)
1 parent 63093c8 commit 3756e4f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/core/frame.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -8082,7 +8082,9 @@ def update(
80828082
if mask.all():
80838083
continue
80848084

8085-
self.loc[:, col] = expressions.where(mask, this, that)
8085+
with warnings.catch_warnings():
8086+
warnings.filterwarnings("ignore", "In a future version, `df.iloc")
8087+
self.loc[:, col] = expressions.where(mask, this, that)
80868088

80878089
# ----------------------------------------------------------------------
80888090
# Data reshaping

pandas/tests/frame/methods/test_update.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ def test_update_from_non_df(self):
136136
def test_update_datetime_tz(self):
137137
# GH 25807
138138
result = DataFrame([pd.Timestamp("2019", tz="UTC")])
139-
result.update(result)
139+
with tm.assert_produces_warning(None):
140+
result.update(result)
140141
expected = DataFrame([pd.Timestamp("2019", tz="UTC")])
141142
tm.assert_frame_equal(result, expected)
142143

0 commit comments

Comments
 (0)