Skip to content

Commit e406b0f

Browse files
committed
check equality of frames and series
1 parent 6963374 commit e406b0f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/tests/frame/indexing/test_mask.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ def test_mask_pos_args_deprecation(self):
101101
r"arguments 'self' and 'cond' will be keyword-only"
102102
)
103103
with tm.assert_produces_warning(FutureWarning, match=msg):
104-
df.mask(cond, other)
105-
106-
# tm.assert_frame_equal(df.mask(cond, other), df.mask(cond, other=other))
104+
tm.assert_frame_equal(df.mask(cond, other), df.mask(cond, other=other))
107105

108106

109107
def test_mask_try_cast_deprecated(frame_or_series):
@@ -137,4 +135,4 @@ def test_mask_stringdtype():
137135
index=["id1", "id2", "id3", "id4"],
138136
dtype=StringDtype(),
139137
)
140-
tm.assert_frame_equal(result, expected)
138+
tm.assert_frame_equal(result, expected)

pandas/tests/series/indexing/test_mask.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def test_mask_stringdtype():
9090

9191
def test_mask_pos_args_deprecation():
9292
# https://github.com/pandas-dev/pandas/issues/41485
93-
df = Series(np.random.randn(6))
94-
cond = df > 0
93+
s = Series(np.random.randn(6))
94+
cond = s > 0
9595

9696
msg = (
9797
r"Starting with Pandas version 2\.0 all arguments of mask except for the "
9898
r"arguments 'self' and 'cond' will be keyword-only"
9999
)
100100
with tm.assert_produces_warning(FutureWarning, match=msg):
101-
df.mask(cond, np.nan)
101+
tm.assert_series_equal(s.mask(cond, np.nan), s.mask(cond, other=np.nan))

0 commit comments

Comments
 (0)