-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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 groupby-resample KeyError when resampling on Index and giving explicit list of columns. #50876
Conversation
@mroeschke, here are the same changes, but on the main branch. |
There is one failing check, but from the error log I think this has nothing to do with my changes. Can anyone comment on why Ubuntu / Numpy Dev is failing? link |
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.
Thanks looks pretty good.
- Could you add a test where a list that contains a column that doesn't exist raises an appropriate error?
- Could you add a test where the list contains multiple columns labels that exist?
@@ -536,3 +537,65 @@ def test_groupby_resample_size_all_index_same(): | |||
), | |||
) | |||
tm.assert_series_equal(result, expected) | |||
|
|||
|
|||
class TestGroupByResampleTimeIndex(unittest.TestCase): |
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.
Could you keep the tests as python functions? We don't use unittest
.
Sure, I'll just revert the last commit. |
…ate code." This reverts commit d522606.
@mroeschke , I was typing up that question as I didn't see |
Is there anything else I should do for this PR or can I consider my portion of the work done? |
Thanks @czroth |
…licit list of columns. (pandas-dev#50876) * Add failing test reproducing groupby-resample KeyError (pandas-dev#50840) * Fix groupby-resample KeyError (pandas-dev#50840) by adding None check. * Update whatsnew for pandas-dev#50840 * Improve coverage with multi and missing column groupby-resample tests. * Refactor groupby-resample tests via TestCase to remove duplicate code. * Revert "Refactor groupby-resample tests via TestCase to remove duplicate code." This reverts commit d522606. * Fix typo in bug fix entry for pandas-dev#50840 in doc/source/whatsnew/v2.0.0.rst
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.