codeant-ai-for-open-source[bot] commented on code in PR #41935:
URL: https://github.com/apache/superset/pull/41935#discussion_r3564648440
##########
tests/unit_tests/mcp_service/test_mcp_server.py:
##########
@@ -144,6 +144,18 @@ def test_suppress_third_party_warnings():
]
assert len(google_filters) >= 1, "Expected google FutureWarning filter"
+ # Verify pkg_resources UserWarning filter is installed (sqlalchemy-redshift
+ # triggers this via a late import on Redshift-backed connections; see
+ # superset/db_engine_specs/redshift.py for the full rationale)
+ pkg_resources_filters = [
+ f
+ for f in warnings.filters
+ if f[0] == "ignore"
+ and isinstance(f[1], re.Pattern)
+ and f[1].pattern == r"pkg_resources is deprecated as an API"
+ ]
+ assert len(pkg_resources_filters) >= 1, "Expected pkg_resources warning
filter"
Review Comment:
**Suggestion:** Add an explicit type annotation to the newly introduced
warning-filter collection variable. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The added local variable `pkg_resources_filters` is a clearly typable Python
variable introduced in a new hunk and it has no annotation. This matches the
rule requiring type hints for relevant variables that 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=56a8f8091fab4292afe11ae0b7390cff&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=56a8f8091fab4292afe11ae0b7390cff&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/mcp_service/test_mcp_server.py
**Line:** 150:157
**Comment:**
*Custom Rule: Add an explicit type annotation to the newly introduced
warning-filter collection variable.
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%2F41935&comment_hash=a0822a4ccb5468378d3a78a5ef9c93ab6c04f4ff138b9d30fb727b83bb7627d4&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41935&comment_hash=a0822a4ccb5468378d3a78a5ef9c93ab6c04f4ff138b9d30fb727b83bb7627d4&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]