ktmud commented on code in PR #20552:
URL: https://github.com/apache/superset/pull/20552#discussion_r928021972
##########
superset/reports/commands/create.py:
##########
@@ -117,20 +122,28 @@ def validate(self) -> None:
raise exception
def _validate_report_extra(self, exceptions: List[ValidationError]) ->
None:
- extra = self._properties.get("extra")
+ extra: Optional[ReportScheduleExtra] = self._properties.get("extra")
dashboard = self._properties.get("dashboard")
if extra is None or dashboard is None:
return
- dashboard_tab_ids = extra.get("dashboard_tab_ids")
- if dashboard_tab_ids is None:
+ dashboard_state = extra.get("dashboard")
+ if not dashboard_state:
return
- position_data = json.loads(dashboard.position_json)
- invalid_tab_ids = [
- tab_id for tab_id in dashboard_tab_ids if tab_id not in
position_data
- ]
+
+ position_data = json.loads(dashboard.position_json or "{}")
+ active_tabs = dashboard_state.get("activeTabs") or []
+ anchor = dashboard_state.get("anchor")
+ invalid_tab_ids = {
+ tab_id for tab_id in active_tabs if tab_id not in position_data
+ }
Review Comment:
I think `|` is actually union. What I needed is `set(a) - set(b)`.
--
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]