BigQuery: Hide error traceback in BigQuery cell magic #8808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #6848.
This PR makes sure that long tracebacks are hidden on exceptions when using
%%bigquery
cell magic, and only the relevant info is printed out.How to test
%%bigquery
cell magic:Actual result (before the fix):
An error is printed out, including the full traceback of internal calls.
Expected result (after the fix):
Only the relevant error info is printed out, i.e. without the traceback, as the latter can be considered an internal detail of the cell magic.
Things to discuss
It might not be desirable for the exception to be swallowed and replaced with a simple output to stdout. Should not make any difference for users, unless some of them use%%bigquery
cell magic programmatically?No, as no one should be using the
%%bigquery
magic outside of a Jupyter environment