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

Suppress the bigquery job sql in exception messages (#2383) #2393

Merged
merged 1 commit into from
May 4, 2020

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented May 4, 2020

resolves #2383

Description

The bigquery library appends the job sql to the exception message, but we don't want that.

There are a couple other paths this could go down instead, I'm not sure which is the most future-proof:

  • look at exception.args[0], which will have the original message it got
  • look at exception.errors, which will be a list of dicts. Each member of the list (apparently) will have a message key that is the original message.

The other options depend upon google not changing internal workings of their libraries, this option depends on google not changing their error messages. Hard to say what's better, but I kind of assume the output is more reliable than internals!

I figure if the "string contains" check fails it will fail in an annoying-but-not-critical way, as opposed to AttributeErrors in exception handlers.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot cla-bot bot added the cla:yes label May 4, 2020
@beckjake beckjake requested a review from drewbanin May 4, 2020 16:38
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

LGTM!

@beckjake beckjake merged commit c237c8e into dev/octavius-catto May 4, 2020
@beckjake beckjake deleted the fix/suppress-bigquery-job-sql branch May 4, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Overly verbose info-level logging for BigQuery queries that 404
2 participants