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


##########
superset/mcp_service/dashboard/tool/update_dashboard.py:
##########
@@ -260,6 +292,20 @@ def _validate_update_request(
                 error_type="DatabaseError",
             )
 
+    # A non-empty owners list must reference existing users. An empty list is
+    # a valid "clear all owners" request and needs no lookup.
+    if request.owners:
+        _users, missing = _resolve_owners(request.owners)

Review Comment:
   **Suggestion:** Annotate the variable holding missing owner IDs in this new 
unpacking statement so the added validation path remains type-explicit. 
[custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   This is another new unpacking assignment that omits an explicit type 
annotation for the local variable `missing`, which can be annotated. That is a 
real violation of the type-hint rule.
   </details>
   <details>
   <summary><b>Rule source ๐Ÿ“– </b></summary>
   
   .cursor/rules/dev-standard.mdc (line 28)
   </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=7030d6de09154639b88e42f5f9c1713d&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=7030d6de09154639b88e42f5f9c1713d&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/update_dashboard.py
   **Line:** 298:298
   **Comment:**
        *Custom Rule: Annotate the variable holding missing owner IDs in this 
new unpacking statement so the added validation path remains type-explicit.
   
   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%2F42002&comment_hash=a429fe79230adff027ffe98c242c134de1ac2a59b48c047fb44fff263e28e102&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42002&comment_hash=a429fe79230adff027ffe98c242c134de1ac2a59b48c047fb44fff263e28e102&reaction=dislike'>๐Ÿ‘Ž</a>



##########
superset/mcp_service/dashboard/tool/update_dashboard.py:
##########
@@ -203,6 +227,14 @@ def _apply_field_updates(dashboard: Any, request: 
UpdateDashboardRequest) -> lis
         update_tags(ObjectType.dashboard, dashboard.id, dashboard.tags, 
request.tags)
         changed.append("tags")
 
+    if request.owners is not None:
+        # Full replacement of owners (empty list clears them). IDs are
+        # validated up front in _validate_update_request, so resolving here
+        # only maps the already-verified IDs to user objects.
+        users, _missing = _resolve_owners(request.owners)

Review Comment:
   **Suggestion:** Add an explicit type annotation for the resolved owners 
variables (or annotate the retained variable after unpacking) so this new 
assignment is fully typed. [custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   The new unpacking assignment introduces local variables without an explicit 
type annotation even though the variable shapes are known from the helper 
return type. This matches the rule requiring type hints for new or modified 
Python variables that can be annotated.
   </details>
   <details>
   <summary><b>Rule source ๐Ÿ“– </b></summary>
   
   .cursor/rules/dev-standard.mdc (line 28)
   </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=41ed2536facd4bcb8e49bc6e2f1baf86&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=41ed2536facd4bcb8e49bc6e2f1baf86&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/update_dashboard.py
   **Line:** 234:234
   **Comment:**
        *Custom Rule: Add an explicit type annotation for the resolved owners 
variables (or annotate the retained variable after unpacking) so this new 
assignment 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%2F42002&comment_hash=aa66ae2fea5d60ff1ba05bb212c0816340b75c15ec641e28099d3ca278aa9a6b&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42002&comment_hash=aa66ae2fea5d60ff1ba05bb212c0816340b75c15ec641e28099d3ca278aa9a6b&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