codeant-ai-for-open-source[bot] commented on code in PR #29554:
URL: https://github.com/apache/superset/pull/29554#discussion_r3450014429
##########
superset/commands/dataset/exceptions.py:
##########
@@ -162,11 +165,21 @@ class DatasetInvalidError(CommandInvalidError):
message = _("Dataset parameters are invalid.")
-class DatasetCreateFailedError(CreateFailedError):
+class DatasetSQLStatementErrorMixin(CommandException):
Review Comment:
**Suggestion:** Add a class docstring to describe the purpose and behavior
of this newly introduced exception mixin. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a newly introduced class and it does not include a docstring. The
custom rule requires new Python classes to be documented inline, so the
suggestion identifies a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e52aa520a44346c69e45328f9954cb4f&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=e52aa520a44346c69e45328f9954cb4f&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:** superset/commands/dataset/exceptions.py
**Line:** 168:168
**Comment:**
*Custom Rule: Add a class docstring to describe the purpose and
behavior of this newly introduced exception mixin.
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%2F29554&comment_hash=3d46156aebf092afcdb1dcd635ed98411ce0b3a23d0670b68a8c960afad57926&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=3d46156aebf092afcdb1dcd635ed98411ce0b3a23d0670b68a8c960afad57926&reaction=dislike'>👎</a>
##########
superset/commands/dataset/exceptions.py:
##########
@@ -162,11 +165,21 @@ class DatasetInvalidError(CommandInvalidError):
message = _("Dataset parameters are invalid.")
-class DatasetCreateFailedError(CreateFailedError):
+class DatasetSQLStatementErrorMixin(CommandException):
+ def __init__(
+ self,
+ ex: Optional[Exception] = None,
+ ) -> None:
+ if isinstance(ex, SupersetSecurityException):
+ self.message = str(ex)
+ super().__init__()
Review Comment:
**Suggestion:** Add a method docstring to this new initializer to explain
how the optional exception is handled and when the message is overridden.
[custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This newly added __init__ method has no docstring, and the rule requires
newly added Python functions to include docstrings. The suggestion matches a
real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=34f8e30ade3644a38a93ea322abd64eb&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=34f8e30ade3644a38a93ea322abd64eb&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:** superset/commands/dataset/exceptions.py
**Line:** 169:175
**Comment:**
*Custom Rule: Add a method docstring to this new initializer to explain
how the optional exception is handled and when the message is overridden.
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%2F29554&comment_hash=4e7e30f06f7f628448665a283d4f0ff749ecc2bb6baadf8800ab816e4c81814d&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=4e7e30f06f7f628448665a283d4f0ff749ecc2bb6baadf8800ab816e4c81814d&reaction=dislike'>👎</a>
##########
tests/integration_tests/datasets/api_tests.py:
##########
@@ -887,6 +887,28 @@ def test_create_dataset_with_currency_code_column(self):
assert model.currency_code_column == "currency"
self.items_to_delete = [model]
+ @pytest.mark.usefixtures("load_energy_table_with_slice")
+ def test_create_dataset_with_sql_validate_select_sql(self):
Review Comment:
**Suggestion:** Add full type hints to the new test method signature,
including an explicit return type, to satisfy the requirement that new Python
code is fully typed. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This is a newly added Python test method in changed code, and it has no type
annotations for
the parameter or the return value. The rule requires new Python code to be
fully typed, so
this is a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e4259123cd5e4b099621110146589c5d&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=e4259123cd5e4b099621110146589c5d&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/datasets/api_tests.py
**Line:** 891:891
**Comment:**
*Custom Rule: Add full type hints to the new test method signature,
including an explicit return type, to satisfy the requirement that new Python
code is fully typed.
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%2F29554&comment_hash=6fda76499706859cb7f6f410ef6f1e4a3c18e41ef6eacff79bd337890edd1085&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F29554&comment_hash=6fda76499706859cb7f6f410ef6f1e4a3c18e41ef6eacff79bd337890edd1085&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]