codeant-ai-for-open-source[bot] commented on code in PR #45801:
URL: https://github.com/apache/superset/pull/45801#discussion_r4397543241
##########
superset/db_engine_specs/base.py:
##########
@@ -2701,11 +2711,16 @@ def make_label_compatible(cls, label: str) -> str |
quoted_name:
:return: conditionally mutated label supported by the db engine
"""
label_mutated = cls._mutate_label(label)
+ max_column_name_length = (
+ cls.get_max_column_name_length(database)
+ if database is not None
+ else cls.max_column_name_length
+ )
if (
- cls.max_column_name_length
- and len(label_mutated) > cls.max_column_name_length
+ max_column_name_length
+ and len(label_mutated) > max_column_name_length
):
Review Comment:
**Suggestion:** Oracle enforces this legacy limit in bytes, but `len()`
counts Unicode characters; multibyte labels under 30 characters pass through
and can still fail with ORA-00972.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Rarely` ยท ๐ท๏ธ `Logic error`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e73a1b84e3124efabeb5131f269a32e6&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=e73a1b84e3124efabeb5131f269a32e6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<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:** 2719:2722
**Comment:**
*Logic Error: Oracle enforces this legacy limit in bytes, but `len()`
counts Unicode characters; multibyte labels under 30 characters pass through
and can still fail with ORA-00972.
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%2F45801&comment_hash=8dd6252ccda142a32ff0ef64dbea936258cc1c402e2d565e9159189831bd9142&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45801&comment_hash=8dd6252ccda142a32ff0ef64dbea936258cc1c402e2d565e9159189831bd9142&reaction=dislike'>๐</a>
##########
superset/db_engine_specs/base.py:
##########
@@ -2701,11 +2711,16 @@ def make_label_compatible(cls, label: str) -> str |
quoted_name:
:return: conditionally mutated label supported by the db engine
"""
label_mutated = cls._mutate_label(label)
+ max_column_name_length = (
+ cls.get_max_column_name_length(database)
+ if database is not None
+ else cls.max_column_name_length
+ )
if (
- cls.max_column_name_length
- and len(label_mutated) > cls.max_column_name_length
+ max_column_name_length
+ and len(label_mutated) > max_column_name_length
):
- label_mutated = cls._truncate_label(label)
+ label_mutated = cls._truncate_label(label, max_column_name_length)
Review Comment:
**Suggestion:** `BigQueryEngineSpec` and `DatastoreEngineSpec` override
`_truncate_label` with one parameter, so over-limit labels now raise
`TypeError` when this call passes two.
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes` ยท ๐ท๏ธ `Api mismatch`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8b61ea9e05c24281ad1e437377cc73a5&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=8b61ea9e05c24281ad1e437377cc73a5&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<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:** 2723:2723
**Comment:**
*Api Mismatch: `BigQueryEngineSpec` and `DatastoreEngineSpec` override
`_truncate_label` with one parameter, so over-limit labels now raise
`TypeError` when this call passes two.
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%2F45801&comment_hash=1b15773d0e573749d23aa71a0969f2c1cb0f2714dd5671f8bc25eb95d9d5c6d9&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45801&comment_hash=1b15773d0e573749d23aa71a0969f2c1cb0f2714dd5671f8bc25eb95d9d5c6d9&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]