guilleov commented on code in PR #42002:
URL: https://github.com/apache/superset/pull/42002#discussion_r3578246734
##########
superset/mcp_service/dashboard/tool/update_dashboard.py:
##########
@@ -203,6 +227,15 @@ def _apply_field_updates(dashboard: Any, request:
UpdateDashboardRequest) -> lis
update_tags(ObjectType.dashboard, dashboard.id, dashboard.tags,
request.tags)
changed.append("tags")
+ if request.owners is not None:
+ # Full replacement of owners (empty list clears them). IDs are
+ # validated up front in _validate_update_request, so resolving here
+ # only maps the already-verified IDs to user objects.
+ owner_users: list[Any]
+ owner_users, _missing = _resolve_owners(request.owners)
+ dashboard.owners = owner_users
+ changed.append("owners")
+
Review Comment:
Addressed in 677e531: owners are now resolved and validated exactly once in
`_resolve_and_validate_owners`, and the resolved list is passed to
`_apply_field_updates` for the write. There is no longer a second lookup at
mutation time, so a user removed between validation and the write can no longer
be silently dropped.
--
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]