-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: Rolling.count setting min_periods after call #39604
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
mroeschke
commented
Feb 5, 2021
- closes BUG: Rolling.count modifies 'min_periods' inplace since 1.2.0 #39554
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
@@ -1437,7 +1437,11 @@ def count(self): | |||
FutureWarning, | |||
) | |||
self.min_periods = 0 | |||
return super().count() | |||
result = super().count() |
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.
grr this is not pretty. maybe have a _count() method where you can pass min_periods? (for 1.2.2 this is prob ok, but for 1.3)
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.
Hmm either is a shim that will be removed in 2.0. I think in either way I'll have to do this gymnastics since min_periods
is set globally on the object
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.
ok for here, I was talking about a _count()
(private method) that we could pass thru min_periods
@meeseeksdev backport 1.2.x |
thanks @mroeschke |
This comment has been minimized.
This comment has been minimized.
#39634) Co-authored-by: Matthew Roeschke <[email protected]>