Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BigQuery: Include SQL query and job ID in job errors#8748

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tswast merged 3 commits intogoogleapis:masterfromplamut:iss-5408
Jul 26, 2019

Conversation

@plamut
Copy link
Contributor

@plamutplamut commentedJul 24, 2019
edited
Loading

Closes#5408.

As per user request, this PR adds additional info to any errors that might happen when callingjob.result().

How to test

  • Use BigQuery client to run a query that results in an error - e.g. invalid SQL syntax, unknown table/dataset, etc.

Actual result (before the fix):
The error output only contains the exception traceback.

Actual result (after the fix):
The error output containsall 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.

@plamutplamut added the api: bigqueryIssues related to the BigQuery API. labelJul 24, 2019
@plamutplamut requested a review froma teamJuly 24, 2019 22:38
@googlebotgooglebot added the cla: yesThis human has signed the Contributor License Agreement. labelJul 24, 2019
@plamut
Copy link
ContributorAuthor

Again, one of the unit tests will fail (converting special float to arrow), but it is not related to this PR.

@tseaver
Copy link
Contributor

Looks like we might need to pin one of the dependencies (pyarrow?) to fix our tests.

Copy link
Contributor

@tswasttswast left a comment

Choose a reason for hiding this comment

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

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 versionof 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 appendeddirectly to that attribute.
It's not always the query that causes the error, thus this commitmakes the header text more neutral.
@tswasttswast merged commitd295ec5 intogoogleapis:masterJul 26, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tswasttswasttswast approved these changes

Assignees

No one assigned

Labels

api: bigqueryIssues related to the BigQuery API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BigQuery: Print offending SQL on error with QueryJob.result()

4 participants

@plamut@tseaver@tswast@googlebot

[8]ページ先頭

©2009-2025 Movatter.jp