codeant-ai-for-open-source[bot] commented on code in PR #41492:
URL: https://github.com/apache/superset/pull/41492#discussion_r3572398241
##########
superset/db_engine_specs/mssql.py:
##########
@@ -53,6 +53,11 @@ class MssqlEngineSpec(BaseEngineSpec):
engine = "mssql"
engine_name = "Microsoft SQL Server"
+ # SQL Server quotes identifiers with square brackets; only the closing
bracket
+ # needs escaping (by doubling).
+ identifier_quote_start = "["
+ identifier_quote_end = "]"
Review Comment:
**Suggestion:** Add explicit `str` type annotations to the new class-level
identifier quote attributes. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The custom rule requires type hints on new or modified Python variables that
can be annotated. These class-level attributes are newly added and currently
lack explicit `str` annotations, so this is a real rule violation.
</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=9ec1057601f44ba69427d83dff555c50&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=9ec1057601f44ba69427d83dff555c50&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/db_engine_specs/mssql.py
**Line:** 58:59
**Comment:**
*Custom Rule: Add explicit `str` type annotations to the new
class-level identifier quote attributes.
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%2F41492&comment_hash=61baba9b0db37215ce19778f0ef80c0cb3c5033e4121a962ba1799e3a0f904ac&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=61baba9b0db37215ce19778f0ef80c0cb3c5033e4121a962ba1799e3a0f904ac&reaction=dislike'>๐</a>
##########
superset/databases/schemas.py:
##########
@@ -1085,6 +1085,15 @@ class DatabaseSchemaAccessForFileUploadResponse(Schema):
)
+class IdentifierQuoteSchema(Schema):
+ start = fields.String(
+ metadata={"description": "Character that opens a quoted identifier"}
+ )
Review Comment:
**Suggestion:** Add an explicit type annotation to this new schema field
attribute so it complies with the type-hint requirement for annotatable
variables. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
This is new Python class-level code and the `start` attribute is a variable
assignment that can be annotated. The snippet has no type hint, so it matches
the type-hint rule violation.
</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=8e0a1fe4e5c64884b3eb0a9582afcb3c&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=8e0a1fe4e5c64884b3eb0a9582afcb3c&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/databases/schemas.py
**Line:** 1089:1091
**Comment:**
*Custom Rule: Add an explicit type annotation to this new schema field
attribute so it complies with the type-hint requirement for annotatable
variables.
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%2F41492&comment_hash=72d8edf042698e451fffcbb8cc9a4943c17bf8206076af9aaec8ae6156e3b521&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=72d8edf042698e451fffcbb8cc9a4943c17bf8206076af9aaec8ae6156e3b521&reaction=dislike'>๐</a>
##########
superset/databases/schemas.py:
##########
@@ -1103,6 +1112,12 @@ class EngineInformationSchema(Schema):
supports_schemas = fields.Boolean(
metadata={"description": "The database uses schemas to organize
tables"}
)
+ identifier_quote = fields.Nested(
+ IdentifierQuoteSchema,
+ metadata={
+ "description": "Characters used to quote identifiers for this
dialect"
+ },
+ )
Review Comment:
**Suggestion:** Add an explicit type annotation to this new nested schema
field attribute to satisfy the type-hint rule for new annotatable variables.
[custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
This is also a new class attribute assignment in Python and is
type-annotatable, but no annotation is present. That is a real violation of the
type-hint requirement.
</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=a2fceff3e4b74f788562ef4eaa2c9dc1&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=a2fceff3e4b74f788562ef4eaa2c9dc1&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/databases/schemas.py
**Line:** 1115:1120
**Comment:**
*Custom Rule: Add an explicit type annotation to this new nested schema
field attribute to satisfy the type-hint rule for new annotatable variables.
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%2F41492&comment_hash=636b45cdcd1aa9d7f1c5cc3a740bb398b88c967ef8454787b98af125010b118a&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=636b45cdcd1aa9d7f1c5cc3a740bb398b88c967ef8454787b98af125010b118a&reaction=dislike'>๐</a>
##########
superset/db_engine_specs/base.py:
##########
@@ -534,6 +534,15 @@ class BaseEngineSpec: # pylint:
disable=too-many-public-methods
arraysize = 0
max_column_name_length: int | None = None
+ # Characters used to quote identifiers (table/column names) that aren't
simple.
+ # Defaults to ANSI double quotes; dialects that differ override these โ
e.g.
+ # MySQL/MariaDB use backticks and SQL Server uses square brackets. Embedded
+ # quote characters are escaped by doubling the closing character. These are
+ # surfaced to the client (see `get_public_information`) so identifier
quoting
+ # stays owned by the engine spec rather than duplicated per client.
+ identifier_quote_start = '"'
Review Comment:
**Suggestion:** Add an explicit type annotation to this new class attribute
(for example, annotate it as a string) to satisfy the type-hint requirement for
newly introduced variables. [custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
This is a newly added Python class attribute that could be annotated as a
string, but it is currently assigned without a type hint. That matches the rule
requiring type hints for newly introduced 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=e7e48fdd199e4e24aec50df84c618edd&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=e7e48fdd199e4e24aec50df84c618edd&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/db_engine_specs/base.py
**Line:** 543:543
**Comment:**
*Custom Rule: Add an explicit type annotation to this new class
attribute (for example, annotate it as a string) to satisfy the type-hint
requirement for newly introduced variables.
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%2F41492&comment_hash=c9fec23943e3b8505d18e1b3452bef20347232f8ccd86ab3fe3e8a3d619a8afc&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=c9fec23943e3b8505d18e1b3452bef20347232f8ccd86ab3fe3e8a3d619a8afc&reaction=dislike'>๐</a>
##########
superset/db_engine_specs/mysql.py:
##########
@@ -80,6 +80,10 @@ class MySQLEngineSpec(BasicParametersMixin, BaseEngineSpec):
engine_name = "MySQL"
max_column_name_length = 64
+ # MySQL/MariaDB quote identifiers with backticks rather than ANSI double
quotes.
+ identifier_quote_start = "`"
+ identifier_quote_end = "`"
Review Comment:
**Suggestion:** Add explicit type annotations for the new class-level
identifier quote attributes so they comply with the required type-hinting rule.
[custom_rule]
**Severity Level:** Minor ๐งน
<details>
<summary><b>Why it matters? โญ </b></summary>
The new class-level attributes are plain assignments without type
annotations, and these values can be annotated as class variables. This matches
the type-hinting rule violation.
</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=04ef4759a36a4580816b06bca4b81baf&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=04ef4759a36a4580816b06bca4b81baf&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/db_engine_specs/mysql.py
**Line:** 83:85
**Comment:**
*Custom Rule: Add explicit type annotations for the new class-level
identifier quote attributes so they comply with the required type-hinting rule.
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%2F41492&comment_hash=814d05765d9d8e7130eb6fbdb0863f699760148b3c41419553e0baf770bd6571&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41492&comment_hash=814d05765d9d8e7130eb6fbdb0863f699760148b3c41419553e0baf770bd6571&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]