graceguo-supercat commented on a change in pull request #9213: [fix] remove 
chart id from filter_scopes metadata if chart is not in dash anymore
URL: 
https://github.com/apache/incubator-superset/pull/9213#discussion_r384818983
 
 

 ##########
 File path: superset/utils/dashboard_filter_scopes_converter.py
 ##########
 @@ -77,10 +77,13 @@ def copy_filter_scopes(
 ) -> Dict:
     new_filter_scopes = {}
     for (slice_id, scopes) in old_filter_scopes.items():
-        new_filter_key = old_to_new_slc_id_dict[int(slice_id)]
-        new_filter_scopes[str(new_filter_key)] = scopes
-        for scope in scopes.values():
-            scope["immune"] = [
-                old_to_new_slc_id_dict[slice_id] for slice_id in 
scope.get("immune")
-            ]
+        new_filter_key = old_to_new_slc_id_dict.get(int(slice_id))
 
 Review comment:
   Yes `filter_scopes` metadata, its key `slice_id` is `str`. 
`old_to_new_slc_id_dict` is Dict[int, int]. I agree it is very confusing. But 
in JS, object (or dictionary)'s key is always string, or be casted to string.
   

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