Skip to content

REF: Pre-empt TypeError in groupby #29261

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 2 commits into from
Nov 2, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

cc @WillAyd @jreback, should be orthogonal to #29228.

@gfyoung gfyoung added Groupby Refactor Internal refactoring of code labels Oct 29, 2019
@gfyoung
Copy link
Member

gfyoung commented Oct 29, 2019

Was this TypeError ever tested? Is it possible to cover in the tests?

@jbrockmendel
Copy link
Member Author

Was this TypeError ever tested? Is it possible to cover in the tests?

The pass on L225 is currently reached in the tests. The raise on L227 is not.

if (
f_name not in base.plotting_methods
sdata = splitter._get_sorted_data()
if sdata.ndim == 2 and np.any(sdata.dtypes.apply(is_extension_array_dtype)):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this to the Splittler class something like

@cache_only
def has_extension_array(self):
     return self.data.dtypes.apply(...)

and can handle this on Series & Frame splitter

Copy link
Member Author

Choose a reason for hiding this comment

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

yah, this function is definitely getting refactored in a later pass. id like to get the exceptions sorted out before trying to decide about the refactor

@jreback jreback added this to the 1.0 milestone Nov 2, 2019
@jreback
Copy link
Contributor

jreback commented Nov 2, 2019

k looks fine (hopefully you have followons!). rebase and ping on green.

@jbrockmendel
Copy link
Member Author

ping

@WillAyd WillAyd merged commit d48ccb8 into pandas-dev:master Nov 2, 2019
@WillAyd
Copy link
Member

WillAyd commented Nov 2, 2019

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the faster50 branch November 2, 2019 21:07
Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants