BigQuery: Include SQL query and job ID in job errors#8748
Merged
tswast merged 3 commits intogoogleapis:masterfrom Jul 26, 2019
Merged
BigQuery: Include SQL query and job ID in job errors#8748tswast merged 3 commits intogoogleapis:masterfrom
tswast merged 3 commits intogoogleapis:masterfrom
Conversation
Contributor
Author
|
Again, one of the unit tests will fail (converting special float to arrow), but it is not related to this PR. |
Contributor
|
Looks like we might need to pin one of the dependencies (pyarrow?) to fix our tests. |
tswast
reviewed
Jul 25, 2019
Contributor
tswast
left a comment
There was a problem hiding this comment.
Nice job with the rulers. I like it! One nit-pick re: header for the SQL.
The code for query format in exception messages is a modified version of the original proposal by @bencaine1 in the feature request: googleapis#5408 (comment)
All GoogleAPICallError (GoogleCloudError) instances have the "message" attribute, even in Python 3, thus the additional info can be appended directly to that attribute.
It's not always the query that causes the error, thus this commit makes the header text more neutral.
tswast
approved these changes
Jul 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #5408.
As per user request, this PR adds additional info to any errors that might happen when calling
job.result().How to test
Actual result (before the fix):
The error output only contains the exception traceback.
Actual result (after the fix):
The error output contains all of the following: exception traceback, job ID, the SQL query itself with lines enumerated. The type of the exception with the modified message is the same as the original exception type.