rusackas commented on code in PR #43566:
URL: https://github.com/apache/superset/pull/43566#discussion_r4068662645


##########
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:
   The metadata linter (`lint_metadata.py`, runs in pre-commit with `--strict`) 
reads these blocks statically via `ast`, so a shared constant would come 
through as just a name and fail validation. The repetition is by design here. 
Resolving.



##########
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}&region_name={region_name}"
+        ),

Review Comment:
   Same story as the categories thread: `lint_metadata.py` evaluates `metadata` 
statically via `ast`, so deriving this from `sqlalchemy_uri_placeholder` or a 
shared constant would not survive the pre-commit check. Every other spec 
repeats it the same way. Resolving.



##########
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:
   These blocks have to be literal dicts since `lint_metadata.py` evaluates 
them statically via `ast` in pre-commit, so a shared constant or reusing the 
sibling dict is not really an option. The main Elasticsearch spec repeats its 
own driver string the same way. Resolving.



##########
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:
   Same constraint as the other threads: `lint_metadata.py` reads `metadata` 
statically via `ast` in pre-commit, so this has to stay a literal dict rather 
than reference the driver entry on the SQL spec. Resolving.



-- 
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]

Reply via email to