bito-code-review[bot] commented on code in PR #44573:
URL: https://github.com/apache/superset/pull/44573#discussion_r4089227237


##########
tests/unit_tests/mcp_service/test_mcp_tool_registration.py:
##########
@@ -249,6 +249,46 @@ def _run(coro):
     return asyncio.run(coro)
 
 
+# Tools whose request model tells "field omitted" from "field set to null":
+# omitting leaves the stored value alone, passing null clears it. Their
+# optional fields must not advertise a default, or a client that materialises
+# defaults turns every call into a clear of everything it did not mention.
+OMITTED_MEANS_UNCHANGED_TOOLS = (
+    "update_chart",
+    "update_dashboard",
+    "update_dataset_metric",
+)
+
+
+def _request_model_schema(tool: Any) -> dict[str, Any]:
+    """Return the JSON Schema of a tool's ``request`` argument."""
+    schema = tool.parameters or {}
+    request = schema.get("properties", {}).get("request", {})
+    reference = request.get("$ref", "")
+    if reference.startswith("#/$defs/"):
+        return schema.get("$defs", {}).get(reference.split("/")[-1], {})
+    return request
+
+
+def test_partial_update_tools_advertise_no_null_default():

Review Comment:
   <!-- Bito Reply -->
   The addition of the return type annotation `-> None` to the new test methods 
is correct and aligns with the project's requirement for explicit return type 
hints on all functions.



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