Skip to content

CLN: no longer need to catch AttributeError, IndexError #29591

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
Nov 14, 2019

Conversation

jbrockmendel
Copy link
Member

cc @jreback @WillAyd

As of today, we don't call agg_series unless ngroups > 0, which has the side-benefit that we don't call unless len(self.bins) > 0, which means we no longer risk hitting an IndexError in libreduction L262.

No longer needing to catch AttributeError is [mumble mumble...] I'll figure out what past-me was thinking after a good night's sleep.

except (ValueError, KeyError, AttributeError, IndexError):
# TODO: IndexError can be removed here following GH#29106
# TODO: AttributeError is caused by _index_data hijinx in
# libreduction, can be removed after GH#29160
Copy link
Member

Choose a reason for hiding this comment

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

Why can this AttributeError now be removed? (the mentioned PR wasn't merged)
It's solved in a different way?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was fixed as a side-effect in #29548. It turned out SeriesGrouper was incorrectly failing to update _index_data, only SeriesBinGrouper was doing it correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, so it was the _data -> _index_data change there. I see!

@jreback jreback added Apply Apply, Aggregate, Transform, Map Clean labels Nov 13, 2019
@jreback jreback added this to the 1.0 milestone Nov 13, 2019
@jreback jreback merged commit bceac8e into pandas-dev:master Nov 14, 2019
@jreback
Copy link
Contributor

jreback commented Nov 14, 2019

thanks

@jbrockmendel jbrockmendel deleted the faster-gb3 branch November 14, 2019 15:41
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
Apply Apply, Aggregate, Transform, Map Clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants