Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix sqllab logging (apache#5862)
Browse files Browse the repository at this point in the history
(cherry picked from commit c82cea3)
  • Loading branch information
timifasubaa committed Sep 13, 2018
1 parent a9077a9 commit 0cfc08e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def execute_sql(
user_name=None, session=None, start_time=None,
):
"""Executes the sql query returns the results."""
if store_results:
if store_results and start_time:
# only asynchronous queries
stats_logger.timing(
'sqllab.query.time_pending', utils.now_as_float() - start_time)
Expand Down Expand Up @@ -219,7 +219,7 @@ def handle_error(msg):
logging.info('Running query: \n{}'.format(executed_sql))
logging.info(query.executed_sql)
query_start_time = utils.now_as_float()
db_engine_spec.execute(cursor, query.executed_sql, async_=True)
db_engine_spec.execute(cursor, query.executed_sql, async=True)
logging.info('Handling cursor')
db_engine_spec.handle_cursor(cursor, query, session)
logging.info('Fetching data: {}'.format(query.to_dict()))
Expand Down
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ def results(self, key):
blob = results_backend.get(key)
stats_logger.timing(
'sqllab.query.results_backend_read',
read_from_results_backend_start - utils.now_as_float(),
utils.now_as_float() - read_from_results_backend_start,
)
if not blob:
return json_error_response(
Expand Down

0 comments on commit 0cfc08e

Please sign in to comment.