codeant-ai-for-open-source[bot] commented on code in PR #45675:
URL: https://github.com/apache/superset/pull/45675#discussion_r4387041390
##########
superset/db_engine_specs/oracle.py:
##########
@@ -86,24 +90,57 @@ def get_limit_method(cls, database: Database) ->
LimitMethod:
return cls.limit_method
+ @classmethod
+ def get_max_column_name_length(cls, database: Database) -> int | None:
+ """
+ Cap labels at 30 bytes on Oracle releases before 12.2.
+
+ Those releases reject longer labels with "ORA-00972: identifier is too
+ long". A version given only as "12c" is treated as 12.1, since 30 bytes
+ is accepted by every release.
+ """
+ version = cls.get_server_version(database)
+ if version is not None and version < LONG_IDENTIFIERS_VERSION:
+ return ORACLE_LEGACY_MAX_IDENTIFIER_LENGTH
+
+ return cls.max_column_name_length
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> When Oracle version lookup returns None, retain the configured maximum
identifier length rather than assuming the 30-byte legacy limit; the lookup
failure generally means the subsequent query will fail too, and the fallback
would unnecessarily alter SQL for newer Oracle versions.
**Applied to:**
- `superset/db_engine_specs/oracle.py`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]