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


##########
tests/unit_tests/reports/notifications/slack_tests.py:
##########
@@ -145,6 +145,33 @@ def 
test_get_inline_files_with_screenshots(mock_header_data) -> None:
 
     assert result == ("png", [b"screenshot1", b"screenshot2"])
 
+
+def test_get_inline_files_with_xlsx(mock_header_data) -> None:

Review Comment:
   **Suggestion:** Add a type annotation for the `mock_header_data` parameter 
in this newly added test function so the new Python code is fully typed. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added Python test function, and its `mock_header_data` 
parameter has no type annotation. The custom rule requires newly added Python 
functions 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=3a8f59c40e624b8e8d7d8989bcb25f76&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=3a8f59c40e624b8e8d7d8989bcb25f76&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/reports/notifications/slack_tests.py
   **Line:** 149:149
   **Comment:**
        *Custom Rule: Add a type annotation for the `mock_header_data` 
parameter in this newly added test function so the new Python 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%2F41424&comment_hash=a0c7999936b1eb82c025a7255fed591713406d79aa5cff681354e728168ec060&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41424&comment_hash=a0c7999936b1eb82c025a7255fed591713406d79aa5cff681354e728168ec060&reaction=dislike'>👎</a>



##########
superset/reports/models.py:
##########
@@ -84,8 +84,14 @@ class ReportDataFormat(StrEnum):
     PDF = "PDF"
     PNG = "PNG"
     CSV = "CSV"
+    XLSX = "XLSX"
     TEXT = "TEXT"
 
+    @classmethod
+    def tabular(cls) -> set["ReportDataFormat"]:
+        """Formats produced from tabular chart data via the chart export 
path."""
+        return {cls.CSV, cls.XLSX}

Review Comment:
   **Suggestion:** Add an explicit type hint for the class method parameter so 
the new method has complete parameter and return typing. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added class method in modified Python code, and its `cls` 
parameter has no type annotation. The custom rule requires new Python functions 
and methods to be fully typed, so the suggestion identifies 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=d9b3e27464b4463fb4bab36c7660f0fb&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=d9b3e27464b4463fb4bab36c7660f0fb&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/reports/models.py
   **Line:** 90:93
   **Comment:**
        *Custom Rule: Add an explicit type hint for the class method parameter 
so the new method has complete parameter and return typing.
   
   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%2F41424&comment_hash=de9fd7aa82c48bd69825b69c08c7b304727b7ca54984e5a5d1a4e1dcfc3543a2&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41424&comment_hash=de9fd7aa82c48bd69825b69c08c7b304727b7ca54984e5a5d1a4e1dcfc3543a2&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