codeant-ai-for-open-source[bot] commented on code in PR #41509:
URL: https://github.com/apache/superset/pull/41509#discussion_r3537737204
##########
tests/unit_tests/views/datasource/views_test.py:
##########
@@ -312,3 +312,66 @@ def test_save_non_owner_with_owners_field_is_rejected(
raw_save(_view_self())
mock_security_manager.raise_for_ownership.assert_called_once_with(mock_orm)
+
+
+# ---------------------------------------------------------------------------
+# Datasource.samples
+# ---------------------------------------------------------------------------
+
+
+@patch("superset.views.datasource.views._", lambda s: s)
Review Comment:
**Suggestion:** Replace the inline lambda with a named helper function that
includes explicit parameter and return type annotations, and patch using that
typed helper instead. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The new code introduces an inline lambda without type hints in a modified
Python file. Since the rule requires type hints for new or modified Python code
where annotations can be added, replacing it with a named helper annotated with
explicit parameter and return types is a valid match.
</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=1edc5304974548ddb0a35b78ed06b3ef&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=1edc5304974548ddb0a35b78ed06b3ef&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/views/datasource/views_test.py
**Line:** 322:322
**Comment:**
*Custom Rule: Replace the inline lambda with a named helper function
that includes explicit parameter and return type annotations, and patch using
that typed helper instead.
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%2F41509&comment_hash=a00f41bad24cec525243ddc08fb167fd7107eea0366798dcce6070836f9dcdf1&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41509&comment_hash=a00f41bad24cec525243ddc08fb167fd7107eea0366798dcce6070836f9dcdf1&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]