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

[sqllab] More detailed async error messages for sqllab #8164

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

serenajiang
Copy link
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Add source of error (presto, hive, etc.) into error messages for sqllab. This will hopefully confuse users a little less.

REVIEWERS

@etr2460 @graceguo-supercat

@serenajiang serenajiang force-pushed the serena-verbose-sqllab-errors branch 3 times, most recently from 0e22a97 to 9cda5f9 Compare September 3, 2019 22:28
@serenajiang serenajiang closed this Sep 3, 2019
@serenajiang serenajiang reopened this Sep 3, 2019
@codecov-io
Copy link

codecov-io commented Sep 3, 2019

Codecov Report

Merging #8164 into master will not change coverage.
The diff coverage is 60%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #8164   +/-   ##
======================================
  Coverage    66.2%   66.2%           
======================================
  Files         479     479           
  Lines       22930   22930           
  Branches     2524    2524           
======================================
  Hits        15180   15180           
  Misses       7616    7616           
  Partials      134     134
Impacted Files Coverage Δ
superset/db_engine_specs/presto.py 77.8% <0%> (ø) ⬆️
superset/db_engine_specs/hive.py 40.36% <100%> (ø) ⬆️
superset/db_engine_specs/mysql.py 92.15% <100%> (ø) ⬆️
superset/utils/core.py 88.05% <50%> (ø) ⬆️

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 436261e...9cda5f9. Read the comment docs.

@serenajiang serenajiang changed the title [WIP] More detailed async error messages for sqllab [sqllab] More detailed async error messages for sqllab Sep 3, 2019
@@ -200,7 +200,7 @@ def extract_error_message(cls, e):
match = re.search(r'errorMessage="(.*?)(?<!\\)"', msg)
if match:
msg = match.group(1)
return msg
return f"Hive error: {msg}"
Copy link
Member

Choose a reason for hiding this comment

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

I would much prefer to see this in base.py along the lines of f"{self.engine} error: {msg}" for uniformity and only the engine-specific message extraction logic where necessary.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking a similar thing, having each place that returns an error go through an error formatting function that prepends the engine

@serenajiang serenajiang force-pushed the serena-verbose-sqllab-errors branch from 9cda5f9 to 4a4298f Compare September 5, 2019 17:20
@serenajiang serenajiang changed the title [sqllab] More detailed async error messages for sqllab [wip] More detailed async error messages for sqllab Sep 5, 2019
@serenajiang serenajiang force-pushed the serena-verbose-sqllab-errors branch from 4a4298f to 86955b0 Compare September 5, 2019 18:45
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM

@serenajiang serenajiang closed this Sep 5, 2019
@serenajiang serenajiang reopened this Sep 5, 2019
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

one final nit! and i think probably all of these could have str return types if it's not too much trouble

@@ -476,7 +476,11 @@ def handle_cursor(cls, cursor, query, session):
pass

@classmethod
def extract_error_message(cls, e: Exception) -> str:
def extract_error_message(cls, e: Exception):
Copy link
Member

Choose a reason for hiding this comment

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

pls add a return type here! -> str

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a return type for extract_error_message but left all the private _extract_error_messages without a return type. Mostly because I wanted to avoid putting in a # noqa (ugh dict.get). But also, since extract_error_message string formats the result of _extract_error_message, the return type of _extract_error_message shouldn't matter.

@serenajiang serenajiang force-pushed the serena-verbose-sqllab-errors branch from 86955b0 to 5810df2 Compare September 5, 2019 22:43
@serenajiang serenajiang changed the title [wip] More detailed async error messages for sqllab [sqllab] More detailed async error messages for sqllab Sep 6, 2019
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

lgtm, awesome!

@etr2460 etr2460 merged commit 4e2d1c1 into apache:master Sep 9, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 2024
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 size/S 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants