Skip to content

Conversation

@jbrockmendel
Copy link
Member

adding an index to the exception is a nice thought, but ultimately adds more complication than information.

The except AssertionErrors were needed back when the lines below were except Exception, but those have been made more specific, so these are no longer needed

@gfyoung gfyoung added Clean Error Reporting Incorrect or improved errors from pandas labels Oct 31, 2019
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Just a comment about the adapted error message, the rest looks good

raise
for i, v in enumerate(series_gen):
results[i] = self.f(v)
keys.append(v.name)
Copy link
Member

Choose a reason for hiding this comment

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

I personally think this can be informative, though.
Is this that problematic? (we are raising the same exception again, so it is not hiding any exceptions?)

Copy link
Member Author

Choose a reason for hiding this comment

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

The index information can be useful, but this can also make it harder to reason about what parts of the code are exception-raising.

This can go either way. If there's a consensus to keep it, I'll revert.

Copy link
Member

Choose a reason for hiding this comment

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

Can you explain how this makes it harder to reason about? This simply reraises what has been raised (with an edited error message), no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you explain how this makes it harder to reason about?

Well it's an idiosyncratic thing, so no.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. I undestand @jorisvandenbossche concern but this seems not a big deal

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

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

yea agree with everyone on this one :-)

@WillAyd WillAyd merged commit 66cb166 into pandas-dev:master Nov 7, 2019
@jbrockmendel jbrockmendel deleted the faster-exc branch November 7, 2019 21:01
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

Clean Error Reporting Incorrect or improved errors from pandas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants