FrancescoCastaldi commented on code in PR #43695:
URL: https://github.com/apache/superset/pull/43695#discussion_r4418445610


##########
tests/unit_tests/db_engine_specs/test_ascend.py:
##########
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import pytest
+
+from superset.constants import TimeGrain
+from superset.db_engine_specs.ascend import AscendEngineSpec
+from superset.db_engine_specs.impala import ImpalaEngineSpec
+
+
+def test_ascend_properties() -> None:
+    assert AscendEngineSpec.engine == "ascend"
+    assert AscendEngineSpec.engine_name == "Ascend"
+    assert issubclass(AscendEngineSpec, ImpalaEngineSpec)
+
+
+def test_ascend_metadata() -> None:
+    metadata = AscendEngineSpec.metadata
+    assert "Ascend.io" in metadata["description"]

Review Comment:
   Updated the assertion in `test_ascend.py` to check for `Ascend` substring in 
`description` directly, clearing the URL substring sanitization heuristic.



##########
superset/db_engine_specs/databricks.py:
##########
@@ -629,9 +657,22 @@ class 
DatabricksNativeEngineSpec(DatabricksDynamicBaseEngineSpec):
         
"databricks+connector://token:{access_token}@{host}:{port}/{database_name}"
     )
 
-    # Note: Primary metadata is in DatabricksPythonConnectorEngineSpec which
-    # consolidates all Databricks connection methods. This spec exists for
-    # backwards compatibility with legacy databricks-dbapi connections.
+    metadata = {
+        "description": ("Databricks legacy connector using databricks-dbapi."),
+        "logo": "databricks.png",
+        "homepage_url": "https://www.databricks.com/";,
+        "categories": [
+            DatabaseCategory.CLOUD_DATA_WAREHOUSES,
+            DatabaseCategory.ANALYTICAL_DATABASES,
+            DatabaseCategory.HOSTED_OPEN_SOURCE,
+        ],
+        "pypi_packages": ["databricks-dbapi[sqlalchemy]"],

Review Comment:
   Resolved: `DatabricksNativeEngineSpec` metadata has been updated to point to 
`pypi_packages: ['apache-superset[databricks]']`, which resolves to current 
dependencies and avoids `databricks-dbapi` dependency conflicts. Legacy 
ODBC/PyHive specs also explicitly document SQLAlchemy 2.0 incompatibilities 
with tracking links.



##########
superset/db_engine_specs/databricks.py:
##########
@@ -955,6 +980,29 @@ class DatabricksODBCEngineSpec(DatabricksBaseEngineSpec):
     drivers = {"pyodbc": "ODBC driver for SQL endpoint"}
     default_driver = "pyodbc"
 
+    metadata = {
+        "description": ("Databricks SQL Endpoint connectivity via the pyodbc 
driver."),
+        "logo": "databricks.png",
+        "homepage_url": "https://www.databricks.com/";,
+        "categories": [
+            DatabaseCategory.CLOUD_DATA_WAREHOUSES,
+            DatabaseCategory.ANALYTICAL_DATABASES,
+            DatabaseCategory.PROPRIETARY,
+        ],
+        "pypi_packages": ["pyodbc"],

Review Comment:
   Updated `DatabricksODBCEngineSpec` metadata to specify `pypi_packages: 
['databricks-dbapi[odbc]', 'pyodbc']` and documented the SQLAlchemy 2.0 known 
incompatibility.



##########
superset/db_engine_specs/databricks.py:
##########
@@ -974,6 +1022,31 @@ class DatabricksHiveEngineSpec(HiveEngineSpec):
     drivers = {"pyhive": "Hive driver for Interactive Cluster"}
     default_driver = "pyhive"
 
+    metadata = {
+        "description": (
+            "Databricks Interactive Cluster connectivity via the PyHive 
connector."
+        ),
+        "logo": "databricks.png",
+        "homepage_url": "https://www.databricks.com/";,
+        "categories": [
+            DatabaseCategory.CLOUD_DATA_WAREHOUSES,
+            DatabaseCategory.ANALYTICAL_DATABASES,
+            DatabaseCategory.HOSTED_OPEN_SOURCE,
+        ],
+        "pypi_packages": ["pyhive"],

Review Comment:
   Updated `DatabricksHiveEngineSpec` metadata to specify `pypi_packages: 
['databricks-dbapi[hive]', 'pyhive', 'thrift']` to correctly register the 
required dialect components.



##########
superset/db_engine_specs/clickhouse.py:
##########
@@ -261,9 +261,25 @@ class ClickHouseEngineSpec(ClickHouseBaseEngineSpec):
     _show_functions_column = "name"
     supports_file_upload = False
 
-    # Note: Primary metadata is in ClickHouseConnectEngineSpec which 
consolidates
-    # both drivers. This spec exists for backwards compatibility with existing
-    # connections using the clickhouse-sqlalchemy driver.
+    metadata = {
+        "description": (
+            "ClickHouse is an open-source column-oriented database for 
real-time "
+            "analytics using SQL (legacy clickhouse-sqlalchemy connector)."
+        ),
+        "logo": "clickhouse.png",
+        "homepage_url": "https://clickhouse.com/";,
+        "categories": [
+            DatabaseCategory.ANALYTICAL_DATABASES,
+            DatabaseCategory.OPEN_SOURCE,
+        ],
+        "pypi_packages": ["clickhouse-sqlalchemy"],
+        "connection_string": (
+            "clickhouse://{username}:{password}@{host}:{port}/{database}"
+        ),
+        "default_port": 8123,
+        "docs_url": "https://clickhouse.com/docs/";,
+        "sqlalchemy_docs_url": 
"https://github.com/xzkostyan/clickhouse-sqlalchemy";,

Review Comment:
   Explicitly defined `sqlalchemy_docs_url` on `ClickHouseConnectEngineSpec` 
pointing to the official ClickHouse Connect Superset documentation 
(`https://clickhouse.com/docs/en/integrations/sql-clients/superset`), 
preventing legacy driver docs fallback.



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