Skip to content

BUG: raise error for groupby() with invalid tuple key #18826

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

Merged
merged 1 commit into from
Dec 19, 2017

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Dec 18, 2017

@gfyoung gfyoung added Bug Groupby Regression Functionality that used to work in a prior pandas version labels Dec 18, 2017
@@ -2978,7 +2978,8 @@ def is_in_obj(gpr):

def _is_label_like(val):
return (isinstance(val, compat.string_types) or
(val is not None and is_scalar(val)))
(val is not None and is_scalar(val)) or
isinstance(val, tuple))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the second isinstance just be combined with the first, i.e. isinstance(val, (compat.string_types, tuple))?

Copy link
Member Author

@toobaz toobaz Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I had no idea of the support for nested tuples (which is undocumented, but apparently well recognized ). So OK.

@codecov
Copy link

codecov bot commented Dec 19, 2017

Codecov Report

Merging #18826 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18826      +/-   ##
==========================================
- Coverage   91.64%   91.62%   -0.02%     
==========================================
  Files         154      154              
  Lines       51408    51408              
==========================================
- Hits        47113    47104       -9     
- Misses       4295     4304       +9
Flag Coverage Δ
#multiple 89.49% <100%> (ø) ⬆️
#single 40.83% <0%> (-0.12%) ⬇️
Impacted Files Coverage Δ
pandas/core/groupby.py 92.07% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.68% <0%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6a7cc9...5fc5240. Read the comment docs.

@toobaz toobaz force-pushed the groupby_missing_tuple_18798 branch from 9a34ad1 to 5fc5240 Compare December 19, 2017 07:51
@jreback jreback added this to the 0.22.0 milestone Dec 19, 2017
@jreback jreback merged commit 852c53e into pandas-dev:master Dec 19, 2017
@jreback
Copy link
Contributor

jreback commented Dec 19, 2017

thanks!

@toobaz toobaz deleted the groupby_missing_tuple_18798 branch December 19, 2017 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Groupby missing tuple doesn't throw
4 participants