-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
TST: GH34037 add test for type error when using parameter 'min_period' #42940
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
Conversation
pandas/tests/groupby/test_groupby.py
Outdated
| assert result == expected | ||
|
|
||
|
|
||
| def test_rolling_min_period(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to mention in this function title that min_period is incorrect
pandas/tests/groupby/test_groupby.py
Outdated
| test_df.columns = ["name", "val"] | ||
|
|
||
| # correct one | ||
| test_df.groupby("name")["val"].rolling(window=2, min_periods=1).sum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to test this line
pandas/tests/groupby/test_groupby.py
Outdated
| # GH34037 | ||
| result_error_msg = r"__init__\(\) got an unexpected keyword argument 'min_period'" | ||
| with pytest.raises(TypeError, match=result_error_msg): | ||
| name_l = ["Alice"] * 5 + ["Bob"] * 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the setup code should ideally be before the pytest.raises call
98ca0d9 to
5c61723
Compare
|
Thanks @horaceklai |
Uh oh!
There was an error while loading. Please reload this page.