-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Bug: Error when key-only Grouper is passed to groupby in a list (GH14334) #14342
Conversation
@jorisvandenbossche Is this Travis CI build failure something I need to worry about? |
That does not seem related, and I can also not reproduce it locally. I restarted the build. |
Current coverage is 85.26% (diff: 100%)@@ master #14342 diff @@
==========================================
Files 140 140
Lines 50640 50645 +5
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43176 43180 +4
- Misses 7464 7465 +1
Partials 0 0
|
@@ -442,6 +442,11 @@ def test_grouper_creation_bug(self): | |||
result = g.sum() | |||
assert_frame_equal(result, expected) | |||
|
|||
# GH14334 | |||
g = df.groupby([pd.Grouper(key='A')]) |
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.
add a 1-liner explaining the bug
@@ -79,3 +79,4 @@ Performance Improvements | |||
|
|||
Bug Fixes | |||
~~~~~~~~~ | |||
- Bug in ``df.groupby`` where ``TypeError`` raised when key-only Grouper is passed in a list (:issue:`14334`) |
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.
pd.Grouper(key=...)
is passed
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.
you can move this to 0.19.1
@jreback rebased, moved whatsnew to 0.19.1, and made the requested updates |
g = df.groupby([pd.Grouper(key='A')]) | ||
result = g.sum() | ||
assert_frame_equal(result, expected) | ||
|
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.
can you add a test with multiple pd.Grouper
passed (both with keys) and then a string and a Grouper
(unless these combinations already exist)
@jreback multiple column |
thanks! |
@jreback @jorisvandenbossche I see that the PR is closed but it doesn't look like it was merged into master. Was there a problem or does it just take a while? |
@jmmease No, it is merged, just not through the github interface. You can see the merge commit in the "jreback closed this in 4852008 a day ago" message above. If you look at master history, you will also see a commit of you with the PR title as message |
@jorisvandenbossche Ahh, I see. Thanks |
…d to groupby in a list (GH14334) closes pandas-dev#14334 Author: Jon M. Mease <jon.mease@jhuapl.edu> Closes pandas-dev#14342 from jmmease/bug_14334 and squashes the following commits: 5e96797 [Jon M. Mease] Add tests for grouping on two columns cee5ce6 [Jon M. Mease] Added bug description to new test case f9ef05b [Jon M. Mease] Moved whatsnew to 0.19.1 and clarified description 14a4ae6 [Jon M. Mease] Added whatsnew for GH 14334 9805c30 [Jon M. Mease] Fix for GH 14334 dfd3e09 [Jon M. Mease] Added test case for GH 14334 (cherry picked from commit 4852008)
git diff upstream/master | flake8 --diff