-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
chore(bigquery): Add extra logging for BigQuery exceptions so we can have better insight on exceptions #22024
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22024 +/- ##
=======================================
Coverage 67.07% 67.07%
=======================================
Files 1815 1815
Lines 69575 69581 +6
Branches 7486 7486
=======================================
+ Hits 46665 46673 +8
+ Misses 20974 20972 -2
Partials 1936 1936
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
577d90f
to
547a6d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look at inheritance.. come back to this
547a6d6
to
7cadba9
Compare
| . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | | ||
|
||
|
||
bigquery error: 400 Table \"case_detail_all_suites\" must be qualified with a dataset (e.g. dataset.table). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make all the test work with this example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
d1b09a0
to
33d6dd1
Compare
33d6dd1
to
5c8bf8e
Compare
superset/db_engine_specs/bigquery.py
Outdated
try: | ||
return Exception( | ||
str(exception) # pylint: disable=use-maxsplit-arg | ||
.rsplit("\n")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also use .splitlines()[0]
here
.rsplit(":")[1] | ||
.strip() | ||
) | ||
except Exception: # pylint: disable=broad-except |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to get this to raise an exception and wasn't able to. I believe as long as the return value is a string, you should be able to perform all of the operations and don't need to put it in a try catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm if for some unknown reason the Exception has no :
for example, accessing the [1] would cause a: IndexError: list index out of range
. Just adding the try/catch there in case anything like that happens with the message we get.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok I tried it with no new line. That makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @Antonio-RiveroMartnez!
SUMMARY
Some BigQuery exceptions are not being logged with enough information, so we need to add some extra method that parses the original exception and logs the correct message. We also add some unit tests to the new method.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION