From 85d137b20acd4644db8f1df7e947c5d428f18fd5 Mon Sep 17 00:00:00 2001 From: michellethomas Date: Thu, 18 Jan 2018 08:28:26 -0800 Subject: [PATCH] Don't cache if there's no cache key (#4229) --- superset/viz.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/superset/viz.py b/superset/viz.py index 65cc975768..b25d07417a 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -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({