Skip to content

Commit

Permalink
Don't cache if there's no cache key (#4229)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas authored and mistercrunch committed Jan 18, 2018
1 parent a942f81 commit 85d137b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 85d137b

Please sign in to comment.