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

Raise insertion errors from BigQuery #29

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Raise insertion errors from BigQuery #29

merged 1 commit into from
Jul 14, 2022

Conversation

thomasleese
Copy link
Contributor

When inserting data in to BigQuery we need to inspect the response for errors as although it may have a 200 HTTP status code, schema-related errors that occur on insertion are included in the error information of the response.

See https://cloud.google.com/bigquery/docs/error-messages#streaming-success for more information on this.

Trello Card

@duncanjbrown
Copy link
Contributor

🎉 Works very well and causes retries! The log output is still confusingly positive with "Success" and "200" messages — perhaps we can improve that in future.

Screenshot 2022-07-14 at 13 58 38

Re the @insert_errors variable, we're not trapping these anywhere in the gem, so it goes unused — I don't think Sentry can pick it up? Maybe a future improvement to aid quick inspection in error reports could be to munge the message fields from the Google error objects into a string and use that as the exception message?

Copy link
Contributor

@duncanjbrown duncanjbrown left a comment

Choose a reason for hiding this comment

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

great stuff, thanks @thomasleese — approving with one comment about @insert_errors

@thomasleese
Copy link
Contributor Author

Re the @insert_errors variable, we're not trapping these anywhere in the gem, so it goes unused — I don't think Sentry can pick it up? Maybe a future improvement to aid quick inspection in error reports could be to munge the message fields from the Google error objects into a string and use that as the exception message?

I've amended the commit so it now combines the messages in to a single string. I imagine this string could get quite long and may not be useable as it is, but it's better than nothing for now and we can improve it in the future if we need to.

When inserting data in to BigQuery we need to inspect the response for
errors as although it may have a 200 HTTP status code, schema-related
errors that occur on insertion are included in the error information of
the response.

See
https://cloud.google.com/bigquery/docs/error-messages#streaming-success
for more information on this.
@thomasleese thomasleese merged commit e6d7654 into main Jul 14, 2022
@thomasleese thomasleese deleted the insertion-errors branch July 14, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants