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

[sql lab] extract Hive error messages #5495

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

mistercrunch
Copy link
Member

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.

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-io
Copy link

codecov-io commented Jul 26, 2018

Codecov Report

Merging #5495 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
superset/db_engine_specs.py 54.05% <100%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3df82d9...bffb460. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a 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)
Copy link
Member

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. :)

@mistercrunch mistercrunch merged commit 41286b7 into apache:master Jul 26, 2018
@mistercrunch mistercrunch deleted the fix_hive_errors branch July 26, 2018 22:17
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
* [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)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Jul 26, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Jul 27, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Jul 31, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
* [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)
(cherry picked from commit 214f5a9)
mistercrunch added a commit that referenced this pull request Aug 12, 2018
* [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)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [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
@mistercrunch mistercrunch added 🍒 0.27.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* [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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🍒 0.27.0 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants