rebenitez1802 commented on code in PR #45826:
URL: https://github.com/apache/superset/pull/45826#discussion_r4444212430
##########
superset/mcp_service/canvas/tool/apply_canvas_draft_ops.py:
##########
@@ -93,13 +94,15 @@ def _apply_canvas_draft_ops_impl(
),
)
def apply_canvas_draft_ops(
- token: str, revision: int, ops: list[dict[str, Any]]
+ token: str, revision: int, ops: DraftOpsInput
) -> CanvasDraftResponse:
- """Apply operations to a canvas draft, in order and atomically: on any
- error nothing changes and the error names the operation and the path at
- fault. Only the draft changes; ``commit_canvas_draft`` publishes it.
- ``revision`` is the draft revision you last saw; the response carries
- the next one.
+ """Apply operations to a canvas draft, in order and atomically. Only the
+ draft changes; ``commit_canvas_draft`` publishes it. Send the last
+ ``draft_revision`` as ``revision``; the response carries the next one. On
+ ``DraftRevisionConflict``, reload the draft before writing again.
+
+ On any error nothing changes, and the error names the operation and the
+ path at fault. ``ValidationError`` leaves the draft unchanged.
Operations (placement ids are readable slugs; ``parent`` defaults to
Review Comment:
Good call, done in 360221fb08. Every listing that shows the full docstring
also serves the input schema, and search results cut the description at 300
chars before the list starts, so the list was duplication wherever an agent
could see it. The docstring now keeps only what the schema can't express:
`widgetType`+`props` vs `widgetId` on `add` (never both), `set_props` as a
complete replacement read from `get_canvas_draft`'s `widgets`, the
required-nullable `scope`/`value` resets, and the 1-based `layout` grid plus
overlap rules. The native description drops from 2,637 to 1,970 chars; the
regenerated inventory also refreshes `commit_canvas_draft`'s stale entry.
--
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]