Skip to content

CI: Catch FutureWarnings #49287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pandas/tests/frame/test_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,14 @@ class TestDataFrameAnalytics:
],
)
def test_stat_op_api_float_string_frame(self, float_string_frame, axis, opname):
getattr(float_string_frame, opname)(axis=axis)
if opname in ["sum", "min", "max"] and axis == 0:
warn = None
elif opname not in ["count", "nunique"]:
warn = FutureWarning
else:
warn = None
with tm.assert_produces_warning(warn):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add match= here?

are these warnings bc the user needs to change something or bc we need to change something internally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added match. Concerns numeric_only and nuisance columns, so will have to adjust when removing this

getattr(float_string_frame, opname)(axis=axis)
if opname != "nunique":
getattr(float_string_frame, opname)(axis=axis, numeric_only=True)

Expand Down