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


##########
superset/mcp_service/dashboard/tool/duplicate_dashboard.py:
##########
@@ -202,9 +202,7 @@ def _refetch_and_serialize(
             exc_info=True,
         )
         _safe_rollback("dashboard re-fetch")
-        dashboard_url = (
-            f"{get_superset_base_url()}/superset/dashboard/{new_dashboard.id}/"
-        )
+        dashboard_url = 
f"{get_superset_base_url()}/dashboard/{new_dashboard.id}/"

Review Comment:
   **Suggestion:** Add an explicit type annotation for this newly introduced 
local URL variable in the exception path to keep type hints consistent in 
modified code. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is also a newly introduced local variable in modified Python code and 
it can be annotated with a string type. The omission satisfies the stated 
type-hint rule 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=843ad316b586400eaef388142046804d&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=843ad316b586400eaef388142046804d&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:** superset/mcp_service/dashboard/tool/duplicate_dashboard.py
   **Line:** 205:205
   **Comment:**
        *Custom Rule: Add an explicit type annotation for this newly introduced 
local URL variable in the exception path to keep type hints consistent in 
modified 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%2F41758&comment_hash=6ab11d63a362ed3ac722c0fc98243b7156ad91057a469fb949394981cf97d0c5&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41758&comment_hash=6ab11d63a362ed3ac722c0fc98243b7156ad91057a469fb949394981cf97d0c5&reaction=dislike'>👎</a>



##########
superset/mcp_service/dashboard/tool/duplicate_dashboard.py:
##########
@@ -116,7 +116,7 @@ def _serialize_new_dashboard(dashboard: Any) -> 
tuple[DashboardInfo, str]:
     """Build the response ``DashboardInfo`` and URL for the new dashboard."""
     from superset.mcp_service.dashboard.schemas import serialize_tag_object
 
-    dashboard_url = 
f"{get_superset_base_url()}/superset/dashboard/{dashboard.id}/"
+    dashboard_url = f"{get_superset_base_url()}/dashboard/{dashboard.id}/"

Review Comment:
   **Suggestion:** Add an explicit type annotation for this newly introduced 
local URL variable to satisfy the type-hint requirement for relevant new 
variables. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly introduced local variable in modified Python code, and it 
can be explicitly annotated as a string. That matches the type-hint rule for 
relevant variables, so the omission 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=cadd0dd1f6c64677897acd49cdbb3179&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=cadd0dd1f6c64677897acd49cdbb3179&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:** superset/mcp_service/dashboard/tool/duplicate_dashboard.py
   **Line:** 119:119
   **Comment:**
        *Custom Rule: Add an explicit type annotation for this newly introduced 
local URL variable to satisfy the type-hint requirement for relevant new 
variables.
   
   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%2F41758&comment_hash=41016e273795f2717757a87c579c058a3b93c1ecf9ac4509e03de8616823323f&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41758&comment_hash=41016e273795f2717757a87c579c058a3b93c1ecf9ac4509e03de8616823323f&reaction=dislike'>👎</a>



##########
superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py:
##########
@@ -486,9 +486,7 @@ def remove_chart_from_dashboard(  # noqa: C901 — complexity 
is structural (lay
             ],
         )
 
-        dashboard_url = (
-            
f"{get_superset_base_url()}/superset/dashboard/{updated_dashboard.id}/"
-        )
+        dashboard_url = 
f"{get_superset_base_url()}/dashboard/{updated_dashboard.id}/"

Review Comment:
   **Suggestion:** Add an explicit type annotation for the newly introduced 
local variable, e.g. annotate `dashboard_url` as a string. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new local variable `dashboard_url` is introduced without an explicit 
type annotation, and it clearly has a concrete string type. This matches the 
rule requiring type hints on relevant new or modified Python variables that can 
be annotated.
   </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=2b0aff1154504a4b83578262fbe60509&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=2b0aff1154504a4b83578262fbe60509&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:** superset/mcp_service/dashboard/tool/remove_chart_from_dashboard.py
   **Line:** 489:489
   **Comment:**
        *Custom Rule: Add an explicit type annotation for the newly introduced 
local variable, e.g. annotate `dashboard_url` as a string.
   
   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%2F41758&comment_hash=0bc43821cadaba2698967d2c9344c45166e98ed70975a6adcd9cfe23d6a59c8f&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41758&comment_hash=0bc43821cadaba2698967d2c9344c45166e98ed70975a6adcd9cfe23d6a59c8f&reaction=dislike'>👎</a>



##########
superset/mcp_service/dashboard/tool/manage_native_filters.py:
##########
@@ -452,9 +452,7 @@ def manage_native_filters(
                 request.dashboard_id, payload
             ).run()
 
-        dashboard_url = (
-            
f"{get_superset_base_url()}/superset/dashboard/{request.dashboard_id}/"
-        )
+        dashboard_url = 
f"{get_superset_base_url()}/dashboard/{request.dashboard_id}/"

Review Comment:
   **Suggestion:** Add an explicit type annotation for this newly introduced 
local variable to satisfy the type-hint requirement. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new local variable is a plain string assignment in modified Python code 
and could be annotated as `dashboard_url: str = ...`, so it matches the 
type-hint requirement for relevant variables.
   </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=c50f192656a641d791497e89845658ce&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=c50f192656a641d791497e89845658ce&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:** superset/mcp_service/dashboard/tool/manage_native_filters.py
   **Line:** 455:455
   **Comment:**
        *Custom Rule: Add an explicit type annotation for this newly introduced 
local variable to satisfy the type-hint 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%2F41758&comment_hash=381d5ad4e0324475e661b95d93203d547afcd998c19508f44b32b5306cb252be&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41758&comment_hash=381d5ad4e0324475e661b95d93203d547afcd998c19508f44b32b5306cb252be&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