codeant-ai-for-open-source[bot] commented on code in PR #41127:
URL: https://github.com/apache/superset/pull/41127#discussion_r3580509067
##########
tests/integration_tests/sqllab_tests.py:
##########
@@ -763,6 +766,9 @@ def test_execute_sql_statements_ctas(
mock_cursor
)
mock_query.database.db_engine_spec.run_multiple_statements_as_one =
False
+ mock_query.database.mutate_sql_based_on_config.side_effect = (
+ lambda sql_, **kwargs: sql_
+ )
Review Comment:
**Suggestion:** Replace the inline lambda with a named, type-annotated
helper function and assign that function to `side_effect` to satisfy typing
requirements. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The newly added lambda is untyped, so the suggestion correctly identifies a
type-hint omission in modified Python code covered by the rule.
</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=89320fbaff434f32b6f2601a7eb1b113&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=89320fbaff434f32b6f2601a7eb1b113&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/sqllab_tests.py
**Line:** 769:771
**Comment:**
*Custom Rule: Replace the inline lambda with a named, type-annotated
helper function and assign that function to `side_effect` to satisfy typing
requirements.
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%2F41127&comment_hash=76fededc92a63991a5e6258b67750c99f011db3597e0bdd1da88d6af5260ba07&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41127&comment_hash=76fededc92a63991a5e6258b67750c99f011db3597e0bdd1da88d6af5260ba07&reaction=dislike'>๐</a>
##########
tests/integration_tests/sqllab_tests.py:
##########
@@ -663,6 +663,9 @@ def test_execute_sql_statements(
mock_cursor
)
mock_query.database.db_engine_spec.run_multiple_statements_as_one =
False
+ mock_query.database.mutate_sql_based_on_config.side_effect = (
+ lambda sql_, **kwargs: sql_
+ )
Review Comment:
**Suggestion:** Replace the inline lambda with a small named helper function
that includes explicit type annotations for its parameters and return value,
then assign that function to `side_effect`. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The added test code assigns an untyped lambda to `side_effect`. This is a
newly introduced Python callable without type hints, which matches the rule
requiring type annotations for new or modified Python code where applicable.
</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=8a47fd8aab6d4671ae242030f41a194e&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=8a47fd8aab6d4671ae242030f41a194e&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/sqllab_tests.py
**Line:** 666:668
**Comment:**
*Custom Rule: Replace the inline lambda with a small named helper
function that includes explicit type annotations for its parameters and return
value, then assign that function to `side_effect`.
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%2F41127&comment_hash=620607e46ba6229dd771650e91703e1eb94ec966cea9263f63bdfd676d0fa6f5&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41127&comment_hash=620607e46ba6229dd771650e91703e1eb94ec966cea9263f63bdfd676d0fa6f5&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]