Skip to content

Commit 6f8e174

Browse files
Backport PR #49720 on branch 1.5.x (Suppress spurious warning) (#49726)
Backport PR #49720: Suppress spurious warning Co-authored-by: jbrockmendel <[email protected]>
1 parent 63a91d0 commit 6f8e174

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
@@ -8255,7 +8255,9 @@ def update(
82558255
if mask.all():
82568256
continue
82578257

8258-
self.loc[:, col] = expressions.where(mask, this, that)
8258+
with warnings.catch_warnings():
8259+
warnings.filterwarnings("ignore", "In a future version, `df.iloc")
8260+
self.loc[:, col] = expressions.where(mask, this, that)
82598261

82608262
# ----------------------------------------------------------------------
82618263
# 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)