Skip to content
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

Change "report_and_rethrow" to "report() and raise" #3022

Closed
antoniivanov opened this issue Jan 11, 2024 · 0 comments · Fixed by #3057 or #3056
Closed

Change "report_and_rethrow" to "report() and raise" #3022

antoniivanov opened this issue Jan 11, 2024 · 0 comments · Fixed by #3057 or #3056
Assignees

Comments

@antoniivanov
Copy link
Collaborator

Describe the bug

At some points (see here) in the code with catch an exception to report it and then re-throw it back.

This rethrowing though happens inside function report_and_rethrow which causes python to think it's new exception creating more confusing stack trace in where the same exception is basically repeated with "During handling of the above exception, another exception occurred:"

For example

Traceback (most recent call last):
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 220, in _na_arithmetic_op
    result = func(left, right)
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 242, in evaluate
    return _evaluate(op, op_str, a, b)  # type: ignore[misc]
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 73, in _evaluate_standard
    return op(a, b)
TypeError: can only concatenate str (not "int") to str

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/srv/conda/envs/notebook/lib/python3.9/site-packages/vdk/internal/builtin_plugins/run/data_job.py", line 304, in run

Expected behavior

The stack trace is minimized without the unnecessary double messages and report_and_rethrow functions in the stack trace

Additional context
See full logs in stacktrace-rethrow-exception.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment