From 4a148ab81b1210cce5f8bcec5da1e735323a39dd 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 65cc9757684fb..b25d07417abc0 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -282,7 +282,11 @@ def get_payload(self, force=False): 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({