codeant-ai-for-open-source[bot] commented on code in PR #41125:
URL: https://github.com/apache/superset/pull/41125#discussion_r3464201822
##########
tests/integration_tests/sqla_models_tests.py:
##########
@@ -199,8 +199,8 @@ def test_jinja_metrics_and_calc_columns(self,
mock_username):
assert "'foo_P1D'" in query
# assert dataset saved metric
assert "count('bar_P1D')" in query
- # assert adhoc metric
- assert "SUM(CASE WHEN user = 'user_abc' THEN 1 ELSE 0 END)" in query
+ # assert adhoc metric (sanitize_clause preserves the user's SQL
verbatim)
+ assert "SUM(case when user = 'user_abc' then 1 else 0 end)" in query
Review Comment:
**Suggestion:** Since this test method was modified, add full type
annotations to its signature (including parameter types and a `None` return
type) to comply with the typing requirement for changed Python methods.
[custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The surrounding modified test method `test_jinja_metrics_and_calc_columns`
is a Python method without type annotations on its parameter (`mock_username`)
or a return type. Since this is changed Python code, it violates the rule
requiring fully typed new or modified functions/methods.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=66bf817f14e145b1875b2701127e7061&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=66bf817f14e145b1875b2701127e7061&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/sqla_models_tests.py
**Line:** 202:203
**Comment:**
*Custom Rule: Since this test method was modified, add full type
annotations to its signature (including parameter types and a `None` return
type) to comply with the typing requirement for changed Python methods.
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%2F41125&comment_hash=fea85f6c7df8585dcf27d0bf9a63fd7e49442a80f4951a0f2bdbe3425a0b0573&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41125&comment_hash=fea85f6c7df8585dcf27d0bf9a63fd7e49442a80f4951a0f2bdbe3425a0b0573&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]