mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
[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:
committed by
Beto Dealmeida
parent
6e942c9fb3
commit
d427db0a8b
15
superset/utils/decorators.py
Normal file
15
superset/utils/decorators.py
Normal 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)
|
||||
Reference in New Issue
Block a user