mistercrunch commented on a change in pull request #4016: [cache] Using the
query as the basis of the cache key
URL:
https://github.com/apache/incubator-superset/pull/4016#discussion_r159543403
##########
File path: superset/viz.py
##########
@@ -225,44 +223,41 @@ def get_json(self, force=False):
self.get_payload(force),
default=utils.json_int_dttm_ser, ignore_nan=True)
- @property
- def cache_key(self):
- form_data = self.form_data.copy()
- merge_extra_filters(form_data)
- s = str([(k, form_data[k]) for k in sorted(form_data.keys())])
+ def cache_key(self, query_obj):
+ s = self.datasource.get_query_str(query_obj)
Review comment:
This makes it such that `get_query_str` needs to be deterministic. I think
that's the case. Let's note that if we see cache-hit-misses in the future it
may be related to `get_query_str` not being fully deterministic.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services