Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Kuang committed Mar 22, 2021
1 parent 10ef827 commit 27d98f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion superset/reports/commands/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _execute_query(self) -> pd.DataFrame:
)
return self._report_schedule.database.get_df(limited_rendered_sql)
except SoftTimeLimitExceeded as ex:
logger.error("A timeout occurred while executing the alert query: %s", ex)
logger.error("A timeout occurred while executing the alert query: %s", ex)
raise AlertQueryTimeout()
except Exception as ex:
raise AlertQueryError(message=str(ex))
Expand Down
2 changes: 1 addition & 1 deletion superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_sql_results( # pylint: disable=too-many-arguments
)
except SoftTimeLimitExceeded as ex:
logger.error("Query %d: Time limit exceeded", query_id)
logger.debug("Query %d: %s", query.id, ex)
logger.debug("Query %d: %s", query_id, ex)
raise SqlLabTimeoutException(
"SQL Lab timeout. This environment's policy is to kill queries "
"after {} seconds.".format(SQLLAB_TIMEOUT)
Expand Down
8 changes: 4 additions & 4 deletions superset/tasks/async_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import logging
from typing import Any, cast, Dict, Optional

from flask import current_app
from celery.exceptions import SoftTimeLimitExceeded
from flask import current_app

from superset import app
from superset.exceptions import SupersetVizException
Expand All @@ -37,9 +37,9 @@
def load_chart_data_into_cache(
job_metadata: Dict[str, Any], form_data: Dict[str, Any],
) -> None:
from superset.charts.commands.data import (
from superset.charts.commands.data import ( # load here due to circular imports
ChartDataCommand,
) # load here due to circular imports
)

with app.app_context(): # type: ignore
try:
Expand Down Expand Up @@ -67,7 +67,7 @@ def load_chart_data_into_cache(


@celery_app.task(name="load_explore_json_into_cache", soft_time_limit=query_timeout)
def load_explore_json_into_cache(
def load_explore_json_into_cache( # pylint: disable-msg=too-many-locals
job_metadata: Dict[str, Any],
form_data: Dict[str, Any],
response_type: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion superset/tasks/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from typing import Iterator

import croniter
from celery.exceptions import SoftTimeLimitExceeded
from dateutil import parser

from celery.exceptions import SoftTimeLimitExceeded
from superset import app
from superset.commands.exceptions import CommandException
from superset.extensions import celery_app
Expand Down

0 comments on commit 27d98f5

Please sign in to comment.