bito-code-review[bot] commented on PR #44577:
URL: https://github.com/apache/superset/pull/44577#issuecomment-5797504949

   <!-- Bito Reply -->
   The flagged issue is correct. When the dashboard layout is not a dictionary 
(e.g., a JSON string or array), `build_chart_layout_items` returns an empty 
map, but `derive_scopes` may still process filter configurations using the 
original `chartsInScope` values because it does not validate the layout 
structure. 
   
   To resolve this, ensure `derive_scopes` or the functions it calls verify 
that the layout is a valid mapping before attempting to resolve chart IDs. The 
current PR already implements a check in `build_chart_layout_items` and adds a 
test case to verify that empty scopes are returned when the layout is malformed.
   
   **superset/dashboards/filter_scope.py**
   ```
   chart_layout_items: ChartLayoutItems = {}
       if not isinstance(position_data, dict):
           logger.warning("Dashboard layout is not a mapping; no charts are in 
scope")
           return chart_layout_items
   ```


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

To unsubscribe, e-mail: [email protected]

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