codeant-ai-for-open-source[bot] commented on code in PR #40957:
URL: https://github.com/apache/superset/pull/40957#discussion_r3482509152


##########
tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py:
##########
@@ -309,3 +309,152 @@ async def test_xss_only_title_is_rejected(self, 
mcp_server) -> None:
                         }
                     },
                 )
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_replaces(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:

Review Comment:
   **Suggestion:** Add explicit type annotations for all non-`self` parameters 
in this newly added test method signature so it complies with the full-typing 
rule. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added async test method, and the non-self parameters are 
untyped.
   The custom rule requires new Python functions and methods to be fully typed, 
so this
   is a real violation.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4a748c9f15fc4215bf71850d7c26b275&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4a748c9f15fc4215bf71850d7c26b275&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_update_dashboard.py
   **Line:** 318:320
   **Comment:**
        *Custom Rule: Add explicit type annotations for all non-`self` 
parameters in this newly added test method signature so it complies with the 
full-typing rule.
   
   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%2F40957&comment_hash=c244408170c8a9cc1e0ff84aa57c4d8d30fc983ded91d979159fd1d42310288e&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40957&comment_hash=c244408170c8a9cc1e0ff84aa57c4d8d30fc983ded91d979159fd1d42310288e&reaction=dislike'>👎</a>



##########
tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py:
##########
@@ -309,3 +309,152 @@ async def test_xss_only_title_is_rejected(self, 
mcp_server) -> None:
                         }
                     },
                 )
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_replaces(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """``tags`` routes through the same validate/update helpers the REST
+        UpdateDashboardCommand uses, and reports ``tags`` as changed."""
+        from superset.tags.models import ObjectType
+
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": [3, 7]}},
+            )
+
+        mock_validate_tags.assert_called_once()
+        mock_update_tags.assert_called_once()
+        update_args = mock_update_tags.call_args.args
+        assert update_args[0] == ObjectType.dashboard
+        assert update_args[1] == 42
+        assert update_args[3] == [3, 7]
+        payload = json.loads(result.content[0].text)
+        assert "tags" in payload.get("changed_fields", [])
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_empty_list_clears(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:

Review Comment:
   **Suggestion:** Add explicit type annotations for each injected fixture/mock 
argument in this new method signature instead of leaving them untyped. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This newly introduced test method has untyped non-self parameters. That 
violates
   the rule requiring new Python code to be fully typed.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=55fc3e3e72ff4764857d535b668752c1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=55fc3e3e72ff4764857d535b668752c1&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_update_dashboard.py
   **Line:** 348:350
   **Comment:**
        *Custom Rule: Add explicit type annotations for each injected 
fixture/mock argument in this new method signature instead of leaving them 
untyped.
   
   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%2F40957&comment_hash=3e1ce4d62e33c6b1243efca82856d13f363e49a351b64083566d01113a2f6ade&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40957&comment_hash=3e1ce4d62e33c6b1243efca82856d13f363e49a351b64083566d01113a2f6ade&reaction=dislike'>👎</a>



##########
tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py:
##########
@@ -309,3 +309,152 @@ async def test_xss_only_title_is_rejected(self, 
mcp_server) -> None:
                         }
                     },
                 )
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_replaces(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """``tags`` routes through the same validate/update helpers the REST
+        UpdateDashboardCommand uses, and reports ``tags`` as changed."""
+        from superset.tags.models import ObjectType
+
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": [3, 7]}},
+            )
+
+        mock_validate_tags.assert_called_once()
+        mock_update_tags.assert_called_once()
+        update_args = mock_update_tags.call_args.args
+        assert update_args[0] == ObjectType.dashboard
+        assert update_args[1] == 42
+        assert update_args[3] == [3, 7]
+        payload = json.loads(result.content[0].text)
+        assert "tags" in payload.get("changed_fields", [])
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_empty_list_clears(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """An empty ``tags`` list is a full replacement that clears all
+        custom tags — it must still reach ``update_tags`` (not be treated
+        as 'unchanged')."""
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": []}},
+            )
+
+        mock_update_tags.assert_called_once()
+        assert mock_update_tags.call_args.args[3] == []
+
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_typed_metadata_toggles_fold_into_json_metadata(
+        self, mock_session, mock_get, mcp_server
+    ) -> None:

Review Comment:
   **Suggestion:** Add missing parameter type hints for the patched arguments 
and fixture argument in this newly introduced async test method. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new async test method introduces untyped injected parameters. This 
matches the
   custom typing rule for new or modified Python functions/methods.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ef28a7f530914411a13c53e434597d9f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ef28a7f530914411a13c53e434597d9f&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_update_dashboard.py
   **Line:** 369:371
   **Comment:**
        *Custom Rule: Add missing parameter type hints for the patched 
arguments and fixture argument in this newly introduced async test method.
   
   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%2F40957&comment_hash=31e0be00276375ec85b9b61be6e737defa02eafc2744b231f7ea1b89d8ff6035&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40957&comment_hash=31e0be00276375ec85b9b61be6e737defa02eafc2744b231f7ea1b89d8ff6035&reaction=dislike'>👎</a>



##########
tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py:
##########
@@ -309,3 +309,152 @@ async def test_xss_only_title_is_rejected(self, 
mcp_server) -> None:
                         }
                     },
                 )
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_replaces(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """``tags`` routes through the same validate/update helpers the REST
+        UpdateDashboardCommand uses, and reports ``tags`` as changed."""
+        from superset.tags.models import ObjectType
+
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": [3, 7]}},
+            )
+
+        mock_validate_tags.assert_called_once()
+        mock_update_tags.assert_called_once()
+        update_args = mock_update_tags.call_args.args
+        assert update_args[0] == ObjectType.dashboard
+        assert update_args[1] == 42
+        assert update_args[3] == [3, 7]
+        payload = json.loads(result.content[0].text)
+        assert "tags" in payload.get("changed_fields", [])
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_empty_list_clears(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """An empty ``tags`` list is a full replacement that clears all
+        custom tags — it must still reach ``update_tags`` (not be treated
+        as 'unchanged')."""
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": []}},
+            )
+
+        mock_update_tags.assert_called_once()
+        assert mock_update_tags.call_args.args[3] == []
+
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_typed_metadata_toggles_fold_into_json_metadata(
+        self, mock_session, mock_get, mcp_server
+    ) -> None:
+        """Typed convenience fields are merged into json_metadata without
+        clobbering unrelated keys."""
+        dash = _mock_dashboard(
+            id=42, json_metadata=json.dumps({"label_colors": {"A": "#111"}})
+        )
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {
+                    "request": {
+                        "identifier": 42,
+                        "cross_filters_enabled": False,
+                        "refresh_frequency": 300,
+                        "filter_bar_orientation": "HORIZONTAL",
+                    }
+                },
+            )
+
+        merged = json.loads(dash.json_metadata)
+        assert merged["cross_filters_enabled"] is False
+        assert merged["refresh_frequency"] == 300
+        assert merged["filter_bar_orientation"] == "HORIZONTAL"
+        assert merged["label_colors"] == {"A": "#111"}  # preserved
+        payload = json.loads(result.content[0].text)
+        assert "json_metadata" in payload.get("changed_fields", [])
+
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_typed_metadata_conflict_is_rejected(
+        self, mock_session, mock_get, mcp_server
+    ) -> None:

Review Comment:
   **Suggestion:** Add explicit type annotations to all non-`self` parameters 
in this new method to satisfy the repository typing requirement. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added method with untyped non-self parameters, so it 
violates the
   repository rule that new Python methods should include type hints.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=55e6cfd47b8a4693bbafa7039611b16a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=55e6cfd47b8a4693bbafa7039611b16a&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_update_dashboard.py
   **Line:** 403:405
   **Comment:**
        *Custom Rule: Add explicit type annotations to all non-`self` 
parameters in this new method to satisfy the repository typing requirement.
   
   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%2F40957&comment_hash=9d62066505f0dc9a29127ef67ff4629c5c5d21642606d7908f41f957c990b942&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40957&comment_hash=9d62066505f0dc9a29127ef67ff4629c5c5d21642606d7908f41f957c990b942&reaction=dislike'>👎</a>



##########
tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py:
##########
@@ -309,3 +309,152 @@ async def test_xss_only_title_is_rejected(self, 
mcp_server) -> None:
                         }
                     },
                 )
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_replaces(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """``tags`` routes through the same validate/update helpers the REST
+        UpdateDashboardCommand uses, and reports ``tags`` as changed."""
+        from superset.tags.models import ObjectType
+
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": [3, 7]}},
+            )
+
+        mock_validate_tags.assert_called_once()
+        mock_update_tags.assert_called_once()
+        update_args = mock_update_tags.call_args.args
+        assert update_args[0] == ObjectType.dashboard
+        assert update_args[1] == 42
+        assert update_args[3] == [3, 7]
+        payload = json.loads(result.content[0].text)
+        assert "tags" in payload.get("changed_fields", [])
+
+    @patch("superset.commands.utils.update_tags")
+    @patch("superset.commands.utils.validate_tags")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_update_tags_empty_list_clears(
+        self, mock_session, mock_get, mock_validate_tags, mock_update_tags, 
mcp_server
+    ) -> None:
+        """An empty ``tags`` list is a full replacement that clears all
+        custom tags — it must still reach ``update_tags`` (not be treated
+        as 'unchanged')."""
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            await client.call_tool(
+                "update_dashboard",
+                {"request": {"identifier": 42, "tags": []}},
+            )
+
+        mock_update_tags.assert_called_once()
+        assert mock_update_tags.call_args.args[3] == []
+
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_typed_metadata_toggles_fold_into_json_metadata(
+        self, mock_session, mock_get, mcp_server
+    ) -> None:
+        """Typed convenience fields are merged into json_metadata without
+        clobbering unrelated keys."""
+        dash = _mock_dashboard(
+            id=42, json_metadata=json.dumps({"label_colors": {"A": "#111"}})
+        )
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {
+                    "request": {
+                        "identifier": 42,
+                        "cross_filters_enabled": False,
+                        "refresh_frequency": 300,
+                        "filter_bar_orientation": "HORIZONTAL",
+                    }
+                },
+            )
+
+        merged = json.loads(dash.json_metadata)
+        assert merged["cross_filters_enabled"] is False
+        assert merged["refresh_frequency"] == 300
+        assert merged["filter_bar_orientation"] == "HORIZONTAL"
+        assert merged["label_colors"] == {"A": "#111"}  # preserved
+        payload = json.loads(result.content[0].text)
+        assert "json_metadata" in payload.get("changed_fields", [])
+
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_typed_metadata_conflict_is_rejected(
+        self, mock_session, mock_get, mcp_server
+    ) -> None:
+        """Setting the same key via a typed field AND json_metadata_overrides
+        is ambiguous and rejected before any write."""
+        dash = _mock_dashboard(id=42)
+        mock_get.return_value = dash
+
+        async with Client(mcp_server) as client:
+            result = await client.call_tool(
+                "update_dashboard",
+                {
+                    "request": {
+                        "identifier": 42,
+                        "cross_filters_enabled": False,
+                        "json_metadata_overrides": {"cross_filters_enabled": 
True},
+                    }
+                },
+            )
+
+        payload = json.loads(result.content[0].text)
+        assert "cross_filters_enabled" in (payload.get("error") or "")
+        mock_session.commit.assert_not_called()
+
+    @patch("superset.dashboards.schemas.validate_css")
+    @patch("superset.daos.dashboard.DashboardDAO.get_by_id_or_slug")
+    @patch("superset.extensions.db.session")
+    @pytest.mark.asyncio
+    async def test_invalid_css_is_rejected(
+        self, mock_session, mock_get, mock_validate_css, mcp_server
+    ) -> None:

Review Comment:
   **Suggestion:** Add type hints for `mock_session`, `mock_get`, 
`mock_validate_css`, and `mcp_server` in this new method signature rather than 
leaving those parameters untyped. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The added async test method leaves all injected arguments untyped. Because 
the rule
   requires new Python functions and methods to be fully typed, this is a 
verified issue.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4c393f9ea52d4101a449557e50240d1b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4c393f9ea52d4101a449557e50240d1b&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_update_dashboard.py
   **Line:** 431:433
   **Comment:**
        *Custom Rule: Add type hints for `mock_session`, `mock_get`, 
`mock_validate_css`, and `mcp_server` in this new method signature rather than 
leaving those parameters untyped.
   
   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%2F40957&comment_hash=15b38cd96c6c38d3e9e174c34683cfe3d9c2cdb840698225833127de6a5b8f3d&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40957&comment_hash=15b38cd96c6c38d3e9e174c34683cfe3d9c2cdb840698225833127de6a5b8f3d&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]

Reply via email to