codeant-ai-for-open-source[bot] commented on code in PR #41120:
URL: https://github.com/apache/superset/pull/41120#discussion_r3424997950
##########
tests/unit_tests/commands/sql_lab/test_estimate.py:
##########
@@ -181,19 +181,61 @@ def
test_apply_sql_security_allows_dml_when_enabled(mock_app: MagicMock) -> None
assert command._apply_sql_security("INSERT INTO t VALUES (1)")
+@patch("superset.commands.sql_lab.estimate.Query")
+@patch("superset.commands.sql_lab.estimate.db")
+@patch("superset.commands.sql_lab.estimate.is_feature_enabled",
return_value=False)
@patch("superset.commands.sql_lab.estimate.app")
-def test_apply_sql_security_blocks_disallowed_table(mock_app: MagicMock) ->
None:
+def test_apply_sql_security_blocks_disallowed_table(
+ mock_app: MagicMock,
+ mock_is_feature_enabled: MagicMock,
+ mock_db: MagicMock,
+ mock_query: MagicMock,
+) -> None:
Review Comment:
**Suggestion:** Add an inline docstring at the start of this newly added
test function to document the behavior being verified, consistent with the rule
that all new functions should be documented. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a newly added Python test function and it has no docstring. The
custom rule requires newly added Python functions and classes to include
docstrings, so the suggestion identifies a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f385217a865e4849a35e9f6757463e56&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=f385217a865e4849a35e9f6757463e56&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/commands/sql_lab/test_estimate.py
**Line:** 188:193
**Comment:**
*Custom Rule: Add an inline docstring at the start of this newly added
test function to document the behavior being verified, consistent with the rule
that all new functions should be documented.
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%2F41120&comment_hash=2c394080e67c1526bd1242435a5ea68e7c562c66f56be8d5b25540c804c9bc58&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41120&comment_hash=2c394080e67c1526bd1242435a5ea68e7c562c66f56be8d5b25540c804c9bc58&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]