-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[sql lab] extract Hive error messages #5495
Conversation
So pyhive returns an exception object with a stringified thrift error object. This PR uses a regex to extract the errorMessage portion of that string.
Codecov Report
@@ Coverage Diff @@
## master #5495 +/- ##
==========================================
+ Coverage 63.33% 63.35% +0.02%
==========================================
Files 349 349
Lines 22099 22099
Branches 2455 2455
==========================================
+ Hits 13996 14001 +5
+ Misses 8089 8084 -5
Partials 14 14
Continue to review full report at Codecov.
|
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 never noticed that each engine has a extract_error_message
method. Pretty useful.
msg = str(e) | ||
match = re.search('errorMessage="(.*)", ', msg) | ||
if match: | ||
msg = match.group(1) |
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.
In Python 3.8 we'll be able to write this as:
if match := re.search('errorMessage="(.*)", ', msg):
msg = match.group(1)
I think I like it. :)
* [sql lab] extract Hive error messages So pyhive returns an exception object with a stringified thrift error object. This PR uses a regex to extract the errorMessage portion of that string. * Unit test (cherry picked from commit 41286b7)
* [sql lab] extract Hive error messages So pyhive returns an exception object with a stringified thrift error object. This PR uses a regex to extract the errorMessage portion of that string. * Unit test (cherry picked from commit 41286b7)
* [sql lab] extract Hive error messages So pyhive returns an exception object with a stringified thrift error object. This PR uses a regex to extract the errorMessage portion of that string. * Unit test
* [sql lab] extract Hive error messages So pyhive returns an exception object with a stringified thrift error object. This PR uses a regex to extract the errorMessage portion of that string. * Unit test (cherry picked from commit 41286b7)
So
pyhive
returns an exception object with a stringified thrift errorobject. This PR uses a regex to extract the errorMessage portion of that
string.