Skip to content

pylint: fix misplaced-bare-raise #49018

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 4 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ def _catch_deprecated_value_error(err: Exception) -> None:
# IntervalDtype mismatched 'closed'
pass
elif "Timezones don't match" not in str(err):
raise
raise err
Copy link
Contributor

@akx akx Oct 10, 2022

Choose a reason for hiding this comment

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

This would raise the exception anew and so lose the original traceback. Is that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

missed that, it wasn't the intention. Do you think something like below would suffice?

Suggested change
raise err
raise ValueError(err) from err



class DatetimeLikeBlock(NDArrayBackedExtensionBlock):
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ disable = [
"import-error",
"invalid-repr-returned",
"invalid-unary-operand-type",
"misplaced-bare-raise",
"no-member",
"no-method-argument",
"no-name-in-module",
Expand Down