dpgaspar commented on a change in pull request #15157:
URL: https://github.com/apache/superset/pull/15157#discussion_r651720097



##########
File path: superset/charts/api.py
##########
@@ -589,7 +593,22 @@ def data(self) -> Response:
             and query_context.result_format == ChartDataResultFormat.JSON
             and query_context.result_type == ChartDataResultType.FULL
         ):
+            # First, look for the chart query results in the cache.
+            try:
+                result = command.run(force_cached=True)
+            except ChartDataCacheLoadError:
+                result = None  # type: ignore
+
+            already_cached_result = result is not None
+
+            # If the chart query has already been cached, return it 
immediately.
+            if already_cached_result:
+                return self.send_chart_response(result)

Review comment:
       can you add a test for this code path?




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