Don't cache if there's no cache key (#4229)

This commit is contained in:
michellethomas 2018-01-18 08:28:26 -08:00 committed by Maxime Beauchemin
parent a942f81dfd
commit 85d137b20a
1 changed files with 5 additions and 1 deletions

View File

@ -282,7 +282,11 @@ class BaseViz(object):
data = None
stacktrace = traceback.format_exc()
if data and cache and self.status != utils.QueryStatus.FAILED:
if (
data and
cache_key and
cache and
self.status != utils.QueryStatus.FAILED):
cached_dttm = datetime.utcnow().isoformat().split('.')[0]
try:
cache_value = json.dumps({