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

fix: API logger output #17981

Merged
merged 6 commits into from
Jan 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,10 +2014,7 @@ def sync_druid_source(self) -> FlaskResponse: # pylint: disable=no-self-use
]
DruidCluster = DruidDatasource.cluster_class # pylint: disable=invalid-name
if not user:
err_msg = __(
"Can't find User '%(name)s', please ask your admin " "to create one.",
name=user_name,
)
err_msg = __("Can't find user, please ask your admin to create one.")
logger.error(err_msg, exc_info=True)
return json_error_response(err_msg)
cluster = (
Expand All @@ -2026,10 +2023,7 @@ def sync_druid_source(self) -> FlaskResponse: # pylint: disable=no-self-use
.one_or_none()
)
if not cluster:
err_msg = __(
"Can't find DruidCluster with cluster_name = " "'%(name)s'",
name=cluster_name,
)
err_msg = __("Can't find DruidCluster")
logger.error(err_msg, exc_info=True)
return json_error_response(err_msg)
try:
Expand Down Expand Up @@ -2377,17 +2371,14 @@ def results_exec(key: str) -> FlaskResponse:
)
def stop_query(self) -> FlaskResponse:
client_id = request.form.get("client_id")

query = db.session.query(Query).filter_by(client_id=client_id).one()
if query.status in [
QueryStatus.FAILED,
QueryStatus.SUCCESS,
QueryStatus.TIMED_OUT,
]:
logger.warning(
"Query with client_id %s could not be stopped: "
"query already complete",
str(client_id),
"Query with client_id could not be stopped: query already complete",
)
return self.json_response("OK")

Expand Down