bito-code-review[bot] commented on code in PR #43566:
URL: https://github.com/apache/superset/pull/43566#discussion_r4058339701
##########
superset/db_engine_specs/aurora.py:
##########
@@ -36,6 +37,27 @@ class AuroraMySQLDataAPI(MySQLEngineSpec):
"region_name={region_name}"
)
+ metadata = {
+ "description": (
+ "Amazon Aurora MySQL accessed via the AWS Data API, allowing "
+ "database queries over HTTP without managing persistent
connections."
+ ),
+ "logo": "aws-aurora.jpg",
+ "homepage_url": "https://aws.amazon.com/rds/aurora/",
+ "categories": [
+ DatabaseCategory.CLOUD_AWS,
+ DatabaseCategory.TRADITIONAL_RDBMS,
+ DatabaseCategory.HOSTED_OPEN_SOURCE,
+ ],
+ "pypi_packages": ["sqlalchemy-aurora-data-api"],
+ "connection_string": (
+ "mysql+auroradataapi://{aws_access_id}:{aws_secret_access_key}@/"
+ "{database_name}?aurora_cluster_arn={aurora_cluster_arn}&"
+ "secret_arn={secret_arn}®ion_name={region_name}"
+ ),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated URI template</b></div>
<div id="fix">
`metadata["connection_string"]` (53-57) is byte-identical to the existing
`sqlalchemy_uri_placeholder` (32-38). Two sources of truth for the same URI
template invite drift when the Data API connection format changes. Consider
deriving one from the other or referencing a shared constant.
</div>
</div>
<small><i>Code Review Run #9cdfb9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset/db_engine_specs/aurora.py:
##########
@@ -36,6 +37,27 @@ class AuroraMySQLDataAPI(MySQLEngineSpec):
"region_name={region_name}"
)
+ metadata = {
+ "description": (
+ "Amazon Aurora MySQL accessed via the AWS Data API, allowing "
+ "database queries over HTTP without managing persistent
connections."
+ ),
+ "logo": "aws-aurora.jpg",
+ "homepage_url": "https://aws.amazon.com/rds/aurora/",
+ "categories": [
+ DatabaseCategory.CLOUD_AWS,
+ DatabaseCategory.TRADITIONAL_RDBMS,
+ DatabaseCategory.HOSTED_OPEN_SOURCE,
+ ],
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Repeated category list</b></div>
<div id="fix">
The same `categories` list (and `logo`/`homepage_url`) is repeated in all
four new `metadata` dicts (47-51, 87-91, 122-126, 153-157). A shared constant
for the Aurora category set would keep the four specs consistent if a category
changes.
</div>
</div>
<small><i>Code Review Run #9cdfb9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset/db_engine_specs/ibmi.py:
##########
@@ -28,6 +30,29 @@ class IBMiEngineSpec(Db2EngineSpec):
engine_name = "IBM Db2 for i"
max_column_name_length = 128
+ metadata = {
+ "description": (
+ "IBM Db2 for i is an integrated relational database management "
+ "system optimized for IBM i."
+ ),
+ "logo": "ibm-db2.svg",
+ "homepage_url": "https://www.ibm.com/products/db2-for-i",
+ "categories": [
+ DatabaseCategory.TRADITIONAL_RDBMS,
+ DatabaseCategory.PROPRIETARY,
+ ],
+ "pypi_packages": ["sqlalchemy-ibmi"],
+ "connection_string": "ibmi://{username}:{password}@{host}/{database}",
+ "parameters": {
+ "username": "IBM i user profile",
+ "password": "User password",
+ "host": "Hostname or IP address",
+ "database": "Database name",
+ },
+ "docs_url": "https://github.com/IBM/sqlalchemy-ibmi",
+ "sqlalchemy_docs_url": "https://github.com/IBM/sqlalchemy-ibmi",
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated metadata source</b></div>
<div id="fix">
This `metadata` block duplicates the 'IBM Db2 for i (AS/400)' entry in
`Db2EngineSpec.compatible_databases` (db2.py:65-84): identical
`connection_string`, `pypi_packages`, `docs_url`, `parameters`, `logo`,
`homepage_url`. The class docstring says 'Documentation is in Db2EngineSpec's
compatible_databases section', so this creates two sources of truth that can
diverge (e.g. `database` param is 'Database name' here vs 'Library/schema name'
there). Consolidate to one.
</div>
</div>
<small><i>Code Review Run #9cdfb9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset/db_engine_specs/kusto.py:
##########
@@ -223,6 +223,34 @@ class KustoKqlEngineSpec(BaseEngineSpec): # pylint:
disable=abstract-method
allows_sql_comments = False
run_multiple_statements_as_one = True
+ metadata = {
+ "description": (
+ "Azure Data Explorer (Kusto) using native Kusto Query Language
(KQL) "
+ "for high-performance log and telemetry analytics."
+ ),
+ "logo": "kusto.png",
+ "homepage_url":
"https://azure.microsoft.com/en-us/products/data-explorer/",
+ "categories": [
+ DatabaseCategory.CLOUD_AZURE,
+ DatabaseCategory.ANALYTICAL_DATABASES,
+ DatabaseCategory.PROPRIETARY,
+ ],
+ "pypi_packages": ["sqlalchemy-kusto"],
+ "connection_string": (
+ "kustokql+https://{cluster}.kusto.windows.net/{database}"
+ "?msi=False&azure_ad_client_id={client_id}"
+ "&azure_ad_client_secret={client_secret}"
+ "&azure_ad_tenant_id={tenant_id}"
+ ),
+ "parameters": {
+ "cluster": "Azure Data Explorer cluster name",
+ "database": "Database name",
+ "client_id": "Azure AD application (client) ID",
+ "client_secret": "Azure AD application secret",
+ "tenant_id": "Azure AD tenant ID",
+ },
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated connection metadata</b></div>
<div id="fix">
This `metadata` block duplicates `connection_string`, `parameters`,
`categories`, `logo`, `homepage_url`, and `pypi_packages` already in
`KustoSqlEngineSpec.metadata` (lines 82-145), whose `drivers` list already
documents the KQL driver with the same `kustokql+https://` string. The
connection format now lives in 3 places; a future auth/param change must be
applied to all. Consider a shared constant or referencing the existing driver
entry.
</div>
</div>
<small><i>Code Review Run #9cdfb9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset/db_engine_specs/elasticsearch.py:
##########
@@ -324,6 +324,27 @@ class OpenDistroEngineSpec(BaseEngineSpec): # pylint:
disable=abstract-method
engine = "odelasticsearch"
engine_name = "OpenSearch (OpenDistro)"
+ metadata = {
+ "description": (
+ "OpenSearch (OpenDistro) SQL connector for querying OpenSearch and
"
+ "OpenDistro clusters using SQL syntax."
+ ),
+ "logo": "elasticsearch.png",
+ "homepage_url": "https://opensearch.org/",
+ "categories": [
+ DatabaseCategory.SEARCH_NOSQL,
+ DatabaseCategory.OPEN_SOURCE,
+ ],
+ "pypi_packages": ["elasticsearch-dbapi"],
+ "connection_string":
"odelasticsearch+https://{user}:{password}@{host}:9200/",
+ "default_port": 9200,
+ "parameters": {
+ "user": "OpenSearch username",
+ "password": "OpenSearch password",
+ "host": "OpenSearch host",
+ },
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>duplicated connection string</b></div>
<div id="fix">
The `connection_string`
`odelasticsearch+https://{user}:{password}@{host}:9200/` is duplicated verbatim
from `ElasticSearchEngineSpec.metadata["drivers"]` (line 167). If the URI
template changes, the two copies diverge silently. Extract a shared constant
and reference it in both places.
</div>
</div>
<div id="suggestion">
<div id="issue"><b>duplicated metadata block</b></div>
<div id="fix">
This metadata block largely duplicates `ElasticSearchEngineSpec.metadata`
(lines 138-153): same `logo`, `categories`, `pypi_packages`, `parameters`, and
`default_port`-adjacent fields. Only `description`, `homepage_url`,
`connection_string`, and `default_port` differ. Reusing the sibling metadata
and overriding the deltas would avoid drift.
</div>
</div>
<small><i>Code Review Run #9cdfb9</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]