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


##########
tests/unit_tests/charts/test_client_processing.py:
##########
@@ -2836,6 +2838,64 @@ def 
test_apply_client_processing_csv_format_default_na_behavior():
     )  # Second data row should have empty last_name (NA converted to null)
 
 
+def _assert_xlsx_client_processing(index: bool) -> None:
+    """Assert XLSX post-processing preserves columns and configured index."""
+    source_df = pd.DataFrame(

Review Comment:
   **Suggestion:** Add an explicit type annotation to `source_df` so static 
type checking can validate DataFrame usage in this helper. [custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   The new helper introduces `source_df` without any type annotation, even 
though it is a clearly annotatable pandas DataFrame variable. This matches the 
rule requiring type hints on 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=24a82b52aa514e3aa43829d29a2ad094&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=24a82b52aa514e3aa43829d29a2ad094&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/charts/test_client_processing.py
   **Line:** 2843:2843
   **Comment:**
        *Custom Rule: Add an explicit type annotation to `source_df` so static 
type checking can validate DataFrame usage in this helper.
   
   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%2F40885&comment_hash=1176b3d4f9bca2219ba00251be6ba84ad0defb8ecd0996f90e85a9245e3b4f44&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=1176b3d4f9bca2219ba00251be6ba84ad0defb8ecd0996f90e85a9245e3b4f44&reaction=dislike'>๐Ÿ‘Ž</a>



##########
tests/unit_tests/charts/test_client_processing.py:
##########
@@ -2836,6 +2838,64 @@ def 
test_apply_client_processing_csv_format_default_na_behavior():
     )  # Second data row should have empty last_name (NA converted to null)
 
 
+def _assert_xlsx_client_processing(index: bool) -> None:
+    """Assert XLSX post-processing preserves columns and configured index."""
+    source_df = pd.DataFrame(
+        {
+            "city": ["Paris", "London"],
+            "value": [10, 20],
+        },
+        index=pd.Index(["row-1", "row-2"], name="row"),
+    )
+    result = {
+        "queries": [
+            {
+                "result_format": ChartDataResultFormat.XLSX,
+                "data": excel.df_to_excel(source_df, index=index),
+            }
+        ]
+    }
+    form_data = {

Review Comment:
   **Suggestion:** Add an explicit type annotation to `form_data` to document 
and enforce the expected shape of this newly added request payload. 
[custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   The newly introduced `form_data` dictionary is unannotated in the added 
helper, and it is a relevant local variable that could be typed to improve 
clarity and static checking.
   </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=d6ed68ee6ac24bedb72885aee5b96cf6&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=d6ed68ee6ac24bedb72885aee5b96cf6&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/charts/test_client_processing.py
   **Line:** 2858:2858
   **Comment:**
        *Custom Rule: Add an explicit type annotation to `form_data` to 
document and enforce the expected shape of this newly added request payload.
   
   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%2F40885&comment_hash=15e222cf42f41ca3581d0f71ea044f51f1f2c56a7dae0905937bd97d849c2752&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=15e222cf42f41ca3581d0f71ea044f51f1f2c56a7dae0905937bd97d849c2752&reaction=dislike'>๐Ÿ‘Ž</a>



##########
tests/unit_tests/charts/test_client_processing.py:
##########
@@ -2836,6 +2838,64 @@ def 
test_apply_client_processing_csv_format_default_na_behavior():
     )  # Second data row should have empty last_name (NA converted to null)
 
 
+def _assert_xlsx_client_processing(index: bool) -> None:
+    """Assert XLSX post-processing preserves columns and configured index."""
+    source_df = pd.DataFrame(
+        {
+            "city": ["Paris", "London"],
+            "value": [10, 20],
+        },
+        index=pd.Index(["row-1", "row-2"], name="row"),
+    )
+    result = {

Review Comment:
   **Suggestion:** Add a concrete type annotation for `result` (for example, a 
typed mapping structure) to satisfy the type-hint requirement for newly 
introduced variables. [custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   The `result` payload is newly added in the helper and has no type hint. 
Since it is a Python variable with a definable structure, it falls under 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=48588e2307844f7985e6360891f88323&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=48588e2307844f7985e6360891f88323&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/charts/test_client_processing.py
   **Line:** 2850:2850
   **Comment:**
        *Custom Rule: Add a concrete type annotation for `result` (for example, 
a typed mapping structure) to satisfy the type-hint requirement for newly 
introduced 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%2F40885&comment_hash=ae9bfcaa6d66fb2546afa9b22676cbe3b799dc3c70248768409333a095d745f6&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=ae9bfcaa6d66fb2546afa9b22676cbe3b799dc3c70248768409333a095d745f6&reaction=dislike'>๐Ÿ‘Ž</a>



##########
tests/unit_tests/commands/report/execute_test.py:
##########
@@ -1956,6 +2148,22 @@ def test_get_notification_content_xlsx_format(
     assert content.csv is None
 
 
+@patch("superset.commands.report.execute.feature_flag_manager")
+def test_get_notification_content_xlsx_rejects_dashboard(
+    mock_ff, mocker: MockerFixture
+) -> None:

Review Comment:
   **Suggestion:** Add a concrete type annotation for the untyped patched 
argument so the new test function has fully typed parameters. [custom_rule]
   
   **Severity Level:** Minor ๐Ÿงน
   <details>
   <summary><b>Why it matters? โญ </b></summary>
   
   The new test function adds an untyped parameter `mock_ff` even though it can 
be annotated like `Mock` or `MagicMock`, so this is a real violation of the 
Python type-hint requirement.
   </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=19bcc22f77cb4581b86471deb3a2fe2b&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=19bcc22f77cb4581b86471deb3a2fe2b&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/commands/report/execute_test.py
   **Line:** 2151:2154
   **Comment:**
        *Custom Rule: Add a concrete type annotation for the untyped patched 
argument so the new test function has fully typed parameters.
   
   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%2F40885&comment_hash=f470e2dc3638a3a2c1787eb06803d78fb54c0e810e046e4bdc53c15e3bb06c63&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=f470e2dc3638a3a2c1787eb06803d78fb54c0e810e046e4bdc53c15e3bb06c63&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