codeant-ai-for-open-source[bot] commented on code in PR #41195:
URL: https://github.com/apache/superset/pull/41195#discussion_r3440842724
##########
tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py:
##########
@@ -1012,6 +1021,88 @@ async def
test_list_dashboards_omits_requested_user_directory_fields(
assert field not in data["columns_available"]
+@patch("superset.mcp_service.mcp_core.ModelGetInfoCore._find_object")
[email protected]
+async def test_get_dashboard_info_includes_embedded_uuid(mock_find_object,
mcp_server):
Review Comment:
**Suggestion:** Add explicit type annotations for all parameters and the
return type in this new async test function to comply with the project typing
rule for newly introduced code. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a newly added Python async function in a modified file, and its
parameters are untyped with no return annotation. That directly violates the
rule requiring new Python code to be fully typed.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e3a47a7e320b4f8d8b495559647d4b3a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e3a47a7e320b4f8d8b495559647d4b3a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py
**Line:** 1026:1026
**Comment:**
*Custom Rule: Add explicit type annotations for all parameters and the
return type in this new async test function to comply with the project typing
rule for newly introduced code.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41195&comment_hash=01766622d52977e1878034578a9fa1baddee528d4c652e289d180f4546c6dab6&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41195&comment_hash=01766622d52977e1878034578a9fa1baddee528d4c652e289d180f4546c6dab6&reaction=dislike'>👎</a>
##########
tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py:
##########
@@ -1012,6 +1021,88 @@ async def
test_list_dashboards_omits_requested_user_directory_fields(
assert field not in data["columns_available"]
+@patch("superset.mcp_service.mcp_core.ModelGetInfoCore._find_object")
[email protected]
+async def test_get_dashboard_info_includes_embedded_uuid(mock_find_object,
mcp_server):
+ """Test that get_dashboard_info returns embedded_uuid when set."""
+ from superset.models.embedded_dashboard import EmbeddedDashboard
+
+ dashboard = Mock()
+ dashboard.id = 1
+ dashboard.dashboard_title = "Embedded Dashboard"
+ dashboard.slug = ""
+ dashboard.description = None
+ dashboard.css = None
+ dashboard.certified_by = None
+ dashboard.certification_details = None
+ dashboard.json_metadata = "{}"
+ dashboard.published = True
+ dashboard.is_managed_externally = False
+ dashboard.external_url = None
+ dashboard.created_on = None
+ dashboard.changed_on = None
+ dashboard.created_on_humanized = None
+ dashboard.changed_on_humanized = None
+ dashboard.uuid = "94b826a5-dbd5-473d-ab58-1af676ee07e4"
+ dashboard.url = "/dashboard/1"
+ dashboard.slices = []
+ dashboard.owners = []
+ dashboard.tags = []
+ dashboard.roles = []
+ dashboard.embedded = []
+
+ embedded = Mock(spec=EmbeddedDashboard)
+ embedded.uuid = "37c56048-d3f1-452d-b3ae-0879802dcb1f"
+ dashboard.embedded = [embedded]
+
+ mock_find_object.return_value = dashboard
+ async with Client(mcp_server) as client:
+ result = await client.call_tool(
+ "get_dashboard_info", {"request": {"identifier": 1}}
+ )
+ assert result.data["uuid"] == "94b826a5-dbd5-473d-ab58-1af676ee07e4"
+ assert result.data["embedded_uuid"] ==
"37c56048-d3f1-452d-b3ae-0879802dcb1f"
+
+
+@patch("superset.mcp_service.mcp_core.ModelGetInfoCore._find_object")
[email protected]
+async def test_get_dashboard_info_embedded_uuid_none_when_not_embedded(
+ mock_find_object, mcp_server
+):
Review Comment:
**Suggestion:** Add parameter and return type annotations to this newly
added async test function signature so the new code is fully typed.
[custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This newly added async test function lacks parameter type hints and a return
type annotation. Because it is introduced in the changed code, it matches the
typing rule violation exactly.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=2853179154ae4e5b972625d1a28e0513&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=2853179154ae4e5b972625d1a28e0513&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py
**Line:** 1069:1071
**Comment:**
*Custom Rule: Add parameter and return type annotations to this newly
added async test function signature so the new code is fully typed.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41195&comment_hash=b15565ff784e31ef5103121c525f682bec27f25e4f0affaa8fefcb07997432e0&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41195&comment_hash=b15565ff784e31ef5103121c525f682bec27f25e4f0affaa8fefcb07997432e0&reaction=dislike'>👎</a>
--
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]