Skip to content

Commit

Permalink
viz: hotfix for saving in cache (apache#1922)
Browse files Browse the repository at this point in the history
Fix cache set after c14c7ed update json serializer behaviour
but forget to update one call site.

While at it move payload serialization outside of catch all try
block since we want to see explosions if any.

Fix apache#1910
  • Loading branch information
xrmx authored and mistercrunch committed Jan 10, 2017
1 parent 2a12a3c commit a2c41bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,13 @@ def get_payload(self, force=False):
payload['cached_dttm'] = datetime.now().isoformat().split('.')[0]
logging.info("Caching for the next {} seconds".format(
cache_timeout))
data = json.dumps(
payload,
default=utils.json_int_dttm_ser, ignore_nan=True
)
if PY3:
data = bytes(data, 'utf-8')
try:
data = self.json_dumps(payload)
if PY3:
data = bytes(data, 'utf-8')
cache.set(
cache_key,
zlib.compress(data),
Expand Down

0 comments on commit a2c41bb

Please sign in to comment.