serenajiang commented on a change in pull request #9235: [fix] use 
filter_scopes in dashboard warmup strategy
URL: 
https://github.com/apache/incubator-superset/pull/9235#discussion_r388494739
 
 

 ##########
 File path: superset/tasks/cache.py
 ##########
 @@ -50,18 +50,32 @@ def get_form_data(chart_id, dashboard=None):
         return form_data
 
     json_metadata = json.loads(dashboard.json_metadata)
-
-    # do not apply filters if chart is immune to them
-    if chart_id in json_metadata.get("filter_immune_slices", []):
-        return form_data
-
     default_filters = json.loads(json_metadata.get("default_filters", "null"))
     if not default_filters:
         return form_data
 
-    # are some of the fields in the chart immune to filters?
-    filter_immune_slice_fields = 
json_metadata.get("filter_immune_slice_fields", {})
-    immune_fields = filter_immune_slice_fields.get(str(chart_id), [])
+    # do not apply filters if chart is immune to them
+    immune_fields = []
+    filter_scopes = json_metadata.get("filter_scopes", {})
+    if filter_scopes:
+        for scopes in filter_scopes.values():
+            # for example: scopes = {
 
 Review comment:
   I don't really like this comment, since this field isn't specific to this 
function. If you keep it, maybe it would be good to put it 
[here](https://github.com/apache/incubator-superset/blob/ef2ebbd570524ffede72011803a76eacf1203370/superset/views/dashboard/api.py#L46)?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to