robdiciuccio commented on a change in pull request #11499:
URL: 
https://github.com/apache/incubator-superset/pull/11499#discussion_r538877958



##########
File path: superset/common/query_context.py
##########
@@ -186,9 +199,28 @@ def get_single_payload(self, query_obj: QueryObject) -> 
Dict[str, Any]:
             return {"data": payload["data"]}
         return payload
 
-    def get_payload(self) -> List[Dict[str, Any]]:
-        """Get all the payloads from the QueryObjects"""
-        return [self.get_single_payload(query_object) for query_object in 
self.queries]
+    def get_payload(self, **kwargs: Any) -> Dict[str, Any]:
+        cache_query_context = kwargs.get("cache_query_context", False)
+        force_cached = kwargs.get("force_cached", False)
+
+        # Get all the payloads from the QueryObjects
+        query_results = [
+            self.get_single_payload(query_object, force_cached=force_cached)
+            for query_object in self.queries
+        ]
+        return_value = {"queries": query_results}
+
+        if cache_query_context:
+            cache_key = self.cache_key()
+            set_and_log_cache(
+                cache_manager.cache,

Review comment:
       No, this is caching only the `form_data` sent from the client, not the 
data returned from running the queries.




----------------------------------------------------------------
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]

Reply via email to