aminghadersohi commented on code in PR #40957:
URL: https://github.com/apache/superset/pull/40957#discussion_r3417079521


##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -708,6 +708,138 @@ class GenerateDashboardResponse(BaseModel):
     )
 
 
+class UpdateDashboardRequest(BaseModel):
+    """Request schema for partially updating dashboard metadata.
+
+    All fields except ``dashboard_id`` are optional — only the fields that
+    are provided are changed. ``None`` means "leave unchanged"; to clear a
+    text field (e.g. ``certified_by``) pass an empty string.
+    """
+
+    model_config = ConfigDict(populate_by_name=True)
+
+    dashboard_id: int = Field(..., description="ID of the dashboard to update")
+
+    # Direct dashboard fields (match DashboardPutSchema)
+    dashboard_title: str | None = Field(
+        None,
+        description="New dashboard title.",
+        validation_alias=AliasChoices("dashboard_title", "title", "name"),
+    )
+    slug: str | None = Field(
+        None, description="New URL slug for the dashboard (must be unique)."
+    )
+    published: bool | None = Field(
+        None,
+        description=(
+            "Set to true to publish the dashboard (visible to other users), "
+            "false to unpublish it (draft)."
+        ),
+    )
+    css: str | None = Field(None, description="Custom CSS applied to the 
dashboard.")
+    theme_id: int | None = Field(None, description="Theme ID for the 
dashboard.")
+    certified_by: str | None = Field(
+        None,
+        description=(
+            "Person or group that certified this dashboard. "
+            "Pass an empty string to clear."
+        ),
+    )
+    certification_details: str | None = Field(
+        None,
+        description=("Details of the certification. Pass an empty string to 
clear."),
+    )
+    roles: list[int] | None = Field(
+        None,
+        description=(
+            "FULL REPLACEMENT list of role IDs with dashboard access "
+            "(DASHBOARD_RBAC). The provided list replaces existing roles."
+        ),
+    )
+    tags: list[int] | None = Field(
+        None,
+        description=(
+            "FULL REPLACEMENT list of tag IDs. The provided list replaces "
+            "existing tags — include existing tag IDs to keep them."
+        ),
+    )

Review Comment:
   Intentionally omitted — `owners` was dropped from this tool earlier in 
review (commit 58c1f70fbd8bfb824a7686d39a300c3dd19e3040). Rationale: it was a 
FULL-REPLACEMENT field and `UpdateDashboardCommand` has no "keep ≥1 owner" 
guard, so an admin/LLM could orphan a dashboard; the sibling `update_chart` 
tool also omits it. Owner management will move to a dedicated tool with 
explicit add/remove semantics (tracked in Shortcut sc-111121). Not re-adding 
here.



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