villebro commented on a change in pull request #11499:
URL:
https://github.com/apache/incubator-superset/pull/11499#discussion_r538113940
##########
File path: superset/common/query_context.py
##########
@@ -201,7 +232,18 @@ def cache_timeout(self) -> int:
return self.datasource.database.cache_timeout
return config["CACHE_DEFAULT_TIMEOUT"]
- def cache_key(self, query_obj: QueryObject, **kwargs: Any) ->
Optional[str]:
+ def cache_key(self, **extra: Any) -> str:
+ """
+ The cache key is made out of the key/values from self.cached_values,
plus any
+ other key/values in `extra`
+ """
+ key_prefix = "qc-"
+ cache_dict = self.cache_values.copy()
+ cache_dict.update(extra)
+
+ return generate_cache_key(cache_dict, key_prefix)
Review comment:
I see your point. I just realized that what's being cached is pretty
light, as it's just the `QueryContext`, not the full response payload. This may
very well be a non-issue, and we can probably get back to this later if it
turns out this causes perf issues, but I would assume not.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]