-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Fix type annotations in pandas.core.resample #26398
Conversation
@@ -964,6 +965,7 @@ def __init__(self, obj, *args, **kwargs): | |||
self._groupby.grouper.mutated = True | |||
self.groupby = copy.copy(parent.groupby) | |||
|
|||
@no_type_check |
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.
This file has a set of mismatched signatures that's much more involved to bring into alignment that the ones we did in other PRs.
_upsample
DatetimeIndexResampler
and Resampler
both define an _upsample
method. The two signatures are only marginally different and could be harmonized easily. But _GroupByMixin
defines an _apply
method that is significantly different and then assigns that method to the class's _upsample
variable (as well as _downsample
and _groupby_and_aggregate
).
_downsample
_downsample has similar relationships between
PeriodIndexResampler,
DatetimeIndexResampler, and
_GroupByMixin`.
_groupby_and_aggregate
_groupby_and_aggregate
has similar relationships between Resampler
and _GroupByMixin
.
Some parts of the _apply
signature appear to be unused in this file. I'm investigating how much mucking around I can do with them. It might be possible to bring them all in alignment.
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.
@gwrome there is lots of magic to make grouby/resample/rolling play nicely. But can of course do this another time.
Codecov Report
@@ Coverage Diff @@
## master #26398 +/- ##
==========================================
- Coverage 91.69% 91.68% -0.01%
==========================================
Files 174 174
Lines 50749 50752 +3
==========================================
- Hits 46534 46532 -2
- Misses 4215 4220 +5
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #26398 +/- ##
==========================================
- Coverage 91.69% 91.68% -0.01%
==========================================
Files 174 174
Lines 50749 50752 +3
==========================================
- Hits 46534 46532 -2
- Misses 4215 4220 +5
Continue to review full report at Codecov.
|
thanks |
Part of #25882
git diff upstream/master -u -- "*.py" | flake8 --diff
This PR addresses the following mypy errors in pandas.core.resample: