Skip to content

Commit bfaf1ed

Browse files
jbrockmendelmeeseeksmachine
authored andcommitted
Backport PR pandas-dev#49720: Suppress spurious warning
1 parent 136271a commit bfaf1ed

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)