-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: unnecessary exception catching #29298
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
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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
There was a problem hiding this 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 :-)
adding an index to the exception is a nice thought, but ultimately adds more complication than information.
The
except AssertionError
s were needed back when the lines below wereexcept Exception
, but those have been made more specific, so these are no longer needed