Skip to content

Commit 2131433

Browse files
authored
CI: catch warning produced in resample (#42820)
1 parent 1e88d66 commit 2131433

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/resample/test_resample_api.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,12 @@ def test_agg():
349349
expected = pd.concat([a_mean, a_std, b_mean, b_std], axis=1)
350350
expected.columns = pd.MultiIndex.from_product([["A", "B"], ["mean", "std"]])
351351
for t in cases:
352-
result = t.aggregate([np.mean, np.std])
352+
warn = FutureWarning if t in cases[1:3] else None
353+
with tm.assert_produces_warning(
354+
warn, match="Dropping invalid columns", check_stacklevel=False
355+
):
356+
# .var on dt64 column raises and is dropped
357+
result = t.aggregate([np.mean, np.std])
353358
tm.assert_frame_equal(result, expected)
354359

355360
expected = pd.concat([a_mean, b_std], axis=1)

0 commit comments

Comments
 (0)