codeant-ai-for-open-source[bot] commented on code in PR #40885:
URL: https://github.com/apache/superset/pull/40885#discussion_r3570895764
##########
superset/charts/client_processing.py:
##########
@@ -357,6 +357,13 @@ def apply_client_processing( # noqa: C901
sep=sep,
decimal=decimal,
)
+ elif query["result_format"] == ChartDataResultFormat.XLSX:
+ read_excel_kwargs = (
+ {"index_col": 0}
+ if current_app.config["EXCEL_EXPORT"].get("index", True)
+ else {}
Review Comment:
**Suggestion:** Add an explicit type annotation to `read_excel_kwargs` so
this newly introduced variable is type-hinted in line with the typing rule.
[custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The new local variable `read_excel_kwargs` is introduced without any type
annotation, and it is a variable that can reasonably be annotated (e.g. as a
mapping/dict). This matches the Python type-hint requirement for newly added
code.
</details>
<details>
<summary><b>Rule source ๐ </b></summary>
.cursor/rules/dev-standard.mdc (line 28)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=dd3f8f4f11874c47801ce152bc02d127&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=dd3f8f4f11874c47801ce152bc02d127&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/charts/client_processing.py
**Line:** 360:364
**Comment:**
*Custom Rule: Add an explicit type annotation to `read_excel_kwargs` so
this newly introduced variable is type-hinted in line with the typing rule.
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=d478f6b302f860b7921cb5d77a2dd2405b2d1315d4ca5cb974bfd3fd4fe1d46e&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=d478f6b302f860b7921cb5d77a2dd2405b2d1315d4ca5cb974bfd3fd4fe1d46e&reaction=dislike'>๐</a>
##########
superset/commands/report/execute.py:
##########
@@ -871,6 +907,7 @@ def _get_notification_content(self) -> NotificationContent:
# noqa: C901
:raises: ReportScheduleScreenshotFailedError
"""
csv_data = None
+ xlsx_data = None
Review Comment:
**Suggestion:** Add an explicit type annotation for this newly introduced
optional attachment variable to comply with the type-hint requirement.
[custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The newly introduced local variable is assigned `None` without a type
annotation in Python code that otherwise uses type hints. This matches the
custom rule requiring type hints on new or modified Python code where relevant
variables can be annotated.
</details>
<details>
<summary><b>Rule source ๐ </b></summary>
.cursor/rules/dev-standard.mdc (line 28)
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=36fb6d189944411ca47652cff1a05a1a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=36fb6d189944411ca47652cff1a05a1a&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/commands/report/execute.py
**Line:** 910:910
**Comment:**
*Custom Rule: Add an explicit type annotation for this newly introduced
optional attachment variable to comply with 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%2F40885&comment_hash=913b6861570a9f46f247295fbd935a70ba271a3d5fb8bc72fa225cf64d00610f&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40885&comment_hash=913b6861570a9f46f247295fbd935a70ba271a3d5fb8bc72fa225cf64d00610f&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]