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


##########
superset-frontend/src/pages/SavedQueryList/index.tsx:
##########
@@ -441,6 +441,22 @@ function SavedQueryList({
         size: 'xl',
         id: 'changed_on_delta_humanized',
       },
+      {
+        accessor: 'created_by.first_name',
+        Header: t('Created by'),
+        disableSortBy: true,
+        size: 'xl',
+        Cell: ({
+          row: {
+            original: { created_by: createdBy },
+          },
+        }: any) =>
+          createdBy ? `${createdBy.first_name} ${createdBy.last_name}` : '',

Review Comment:
   **Suggestion:** Replace the new `any` annotation in the cell renderer with a 
concrete row/cell type (or a constrained generic tied to the saved query shape) 
so the new column remains type-safe. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new cell renderer is in a TypeScript/TSX file and explicitly annotates 
the parameter as `any`. This directly violates the rule against newly added or 
modified TS/TSX code using `any`; a concrete row type or narrower generic 
should be used instead.
   </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=626bf8474b9c4cbb9c37dfaf4ee6f695&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=626bf8474b9c4cbb9c37dfaf4ee6f695&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-frontend/src/pages/SavedQueryList/index.tsx
   **Line:** 449:454
   **Comment:**
        *Custom Rule: Replace the new `any` annotation in the cell renderer 
with a concrete row/cell type (or a constrained generic tied to the saved query 
shape) so the new column remains type-safe.
   
   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%2F21769&comment_hash=a9b13a88ee942551ef17d481fba9e708e2f09a0bba7d01e0fc64013edd31d3c4&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F21769&comment_hash=a9b13a88ee942551ef17d481fba9e708e2f09a0bba7d01e0fc64013edd31d3c4&reaction=dislike'>👎</a>



##########
tests/integration_tests/queries/saved_queries/commands_tests.py:
##########
@@ -57,9 +57,11 @@ def tearDown(self):
         db.session.commit()
         super().tearDown()
 
-    @patch("superset.queries.saved_queries.filters.g")
-    def test_export_query_command(self, mock_g):
-        mock_g.user = security_manager.find_user("admin")
+    @patch(
+        
"superset.queries.saved_queries.filters.security_manager.can_access_all_queries"
+    )
+    def test_export_query_command(self, mock_can_access_all_queries):

Review Comment:
   **Suggestion:** Add explicit type annotations for all parameters and the 
return type in this modified test method (for example, annotate the mock 
argument and use `-> None`). [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a modified Python test method in a changed file, and it has no type 
hints on its parameter or return type. The rule requires new or modified Python 
functions/methods/classes 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=514ae5c7995f4303809a1824db7ea097&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=514ae5c7995f4303809a1824db7ea097&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/integration_tests/queries/saved_queries/commands_tests.py
   **Line:** 63:63
   **Comment:**
        *Custom Rule: Add explicit type annotations for all parameters and the 
return type in this modified test method (for example, annotate the mock 
argument and use `-> None`).
   
   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%2F21769&comment_hash=61a746d710448b31d7c620ad2500db28985582721ca5dc6b7b7616d91455a6d3&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F21769&comment_hash=61a746d710448b31d7c620ad2500db28985582721ca5dc6b7b7616d91455a6d3&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