-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
BigQuery: fix swallowed error message #6168
Conversation
When getting a "Cannot query over table (...) without a filter over column(s) (...)", the re-raising happening gobbles up the error message and the context is lost. This may or may not be the right fix, but clearly highlights the issue of `self._query_job.errors` being `None` in that particular context. When that is the case, the only context available is that of `DatabaseError` without any details which clearly isn't enough detail. It seems like wrapping the exception into another exception works as expected and shows both stack traces as shown here:
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
Looks great. CC: @tswast |
except google.cloud.exceptions.GoogleCloudError: | ||
raise exceptions.DatabaseError(self._query_job.errors) | ||
except google.cloud.exceptions.GoogleCloudError as e: | ||
raise exceptions.DatabaseError(self._query_job.errors or e) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The errors on the job resource are mostly redundant with the exception information.
CLAs look good, thanks! |
🔥 🕺 🔥 |
When getting a
Cannot query over table (...) without a filter over column(s) (...)
, the re-raising happening gobbles up the error messageand the context is lost.
This may or may not be the right fix, but clearly highlights the issue
of
self._query_job.errors
beingNone
in that particular context.When that is the case, the only context available is that of
DatabaseError
without any details which clearly isn't enough detail.