[SQL Lab] Allow running multiple statements (#6112)

* Allow running multiple statements from SQL Lab

* fix tests

* More tests

* merge heads

* fix heads
This commit is contained in:
Maxime Beauchemin
2018-12-22 10:28:22 -08:00
committed by Beto Dealmeida
parent 6e942c9fb3
commit d427db0a8b
19 changed files with 357 additions and 205 deletions

View File

@@ -0,0 +1,15 @@
from contextlib2 import contextmanager
from superset.utils.dates import now_as_float
@contextmanager
def stats_timing(stats_key, stats_logger):
"""Provide a transactional scope around a series of operations."""
start_ts = now_as_float()
try:
yield start_ts
except Exception as e:
raise e
finally:
stats_logger.timing(stats_key, now_as_float() - start_ts)