Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

jonmmease
Copy link
Contributor

@jonmmease
Copy link
Contributor Author

@jorisvandenbossche Is this Travis CI build failure something I need to worry about?

@jorisvandenbossche
Copy link
Member

That does not seem related, and I can also not reproduce it locally. I restarted the build.

@codecov-io
Copy link

codecov-io commented Oct 5, 2016

Current coverage is 85.26% (diff: 100%)

Merging #14342 into master will decrease coverage by <.01%

@@             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          

Powered by Codecov. Last update 794f792...5e96797

@@ -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')])
Copy link
Contributor

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`)
Copy link
Contributor

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

Copy link
Contributor

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

@jonmmease
Copy link
Contributor Author

@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)

Copy link
Contributor

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)

@jonmmease
Copy link
Contributor Author

@jreback multiple column pd.Grouper tests added

@jreback jreback closed this in 4852008 Oct 25, 2016
@jreback
Copy link
Contributor

jreback commented Oct 25, 2016

thanks!

@jonmmease
Copy link
Contributor Author

@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?

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Oct 26, 2016

@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

@jonmmease
Copy link
Contributor Author

@jorisvandenbossche Ahh, I see. Thanks

jorisvandenbossche pushed a commit to jorisvandenbossche/pandas that referenced this pull request Nov 2, 2016
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when key-only Grouper is passed to groupby in a list
4 participants