-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
STY: use strict zip in pandas/tests/window
#62852
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
STY: use strict zip in pandas/tests/window
#62852
Conversation
654e2c2 to
20f9d14
Compare
20f9d14 to
b8a0fc9
Compare
2270859 to
8dcd766
Compare
8dcd766 to
a7be4e2
Compare
| DataFrame(values, index=df.loc[index, "C"]) for (values, index) in expected | ||
| ] | ||
| for expected, actual in zip(expecteds, df.rolling(window, on="C")): | ||
| for expected, actual in zip(expecteds, df.rolling(window, on="C"), strict=False): |
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.
Why is this False?
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.
Hi @mroeschke some of the parametrize cases have mismatch lengths which when run with strict=True consistently raise test_iter_rolling_dataframe[None-expected7-2-None] - ValueError: zip() argument 2 is shorter than argument 1
One example is
pandas/pandas/tests/window/test_rolling.py
Line 749 in a7be4e2
| (None, [({}, [])], 2, None), |
None for the df means no valid rolling object, so no windows generated. But the expected side has one item.
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.
I see. Thanks for highlighting.
|
Thanks @zorexsalvo |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.