Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Mar 13, 2023
1 parent 45a0d2a commit f0af241
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 8 additions & 4 deletions superset/tasks/async_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ def load_chart_data_into_cache(
except Exception as ex:
# TODO: QueryContext should support SIP-40 style errors
error = (
ex.message if hasattr(ex, "message") else str(ex)
) # pylint: disable=no-member
ex.message # pylint: disable=no-member
if hasattr(ex, "message")
else str(ex)
)
errors = [{"message": error}]
async_query_manager.update_job(
job_metadata, async_query_manager.STATUS_ERROR, errors=errors
Expand Down Expand Up @@ -160,8 +162,10 @@ def load_explore_json_into_cache( # pylint: disable=too-many-locals
errors = ex.errors # pylint: disable=no-member
else:
error = (
ex.message if hasattr(ex, "message") else str(ex)
) # pylint: disable=no-member
ex.message # pylint: disable=no-member
if hasattr(ex, "message")
else str(ex)
)
errors = [error]

async_query_manager.update_job(
Expand Down
5 changes: 4 additions & 1 deletion superset/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def wrapped(*args: Any, **kwargs: Any) -> Any:
current_app.config["STATS_LOGGER"].gauge(f"{metric_prefix_}.ok", 1)
return result
except Exception as ex:
if hasattr(ex, "status") and ex.status < 500:
if (
hasattr(ex, "status")
and ex.status < 500 # pylint: disable=no-member
):
current_app.config["STATS_LOGGER"].gauge(
f"{metric_prefix_}.warning", 1
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/csv_upload_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def mock_upload_to_s3(filename: str, upload_prefix: str, table: Table) -> str:
# only needed for the hive tests
import docker

client = docker.from_env()
client = docker.from_env() # type: ignore
container = client.containers.get("namenode")
# docker mounted volume that contains csv uploads
src = os.path.join("/tmp/superset_uploads", os.path.basename(filename))
Expand Down

0 comments on commit f0af241

Please sign in to comment.