Skip to content

Commit 01925f6

Browse files
FrancescoCastaldiFrancescoCastaldisadpandajoerusackas
authored
feat(db_engine_specs): complete metadata definitions and add missing unit test suites (#43695)
Signed-off-by: Francesco Castaldi <info@francescocastaldi.it> Signed-off-by: Francesco Castaldi <francesco.castaldi@mapsgroup.it> Signed-off-by: FrancescoCastaldi <info@francescocastaldi.it> Co-authored-by: FrancescoCastaldi <francesco.castaldi@mapsgroup.it> Co-authored-by: Joe Li <joe@preset.io> Co-authored-by: Evan Rusackas <evan@rusackas.com>
1 parent dd23957 commit 01925f6

31 files changed

Lines changed: 1286 additions & 101 deletions

‎superset/db_engine_specs/arc.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class ArcEngineSpec(BaseEngineSpec):
4545
"categories": [DatabaseCategory.OTHER, DatabaseCategory.PROPRIETARY],
4646
"pypi_packages": ["arc-superset-arrow"],
4747
"connection_string": ("arc+arrow://{api_key}@{hostname}:{port}/{database}"),
48+
"default_port": 8000,
4849
"parameters": {
4950
"api_key": "Arc API key",
5051
"hostname": "Arc hostname",

‎superset/db_engine_specs/aurora.py‎

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
from superset.db_engine_specs.base import DatabaseCategory
17+
from superset.db_engine_specs.base import (
18+
AURORA_DATA_API_KNOWN_INCOMPATIBILITIES,
19+
DatabaseCategory,
20+
)
1821
from superset.db_engine_specs.mysql import MySQLEngineSpec
1922
from superset.db_engine_specs.postgres import PostgresEngineSpec
2023

2124

2225
class AuroraMySQLDataAPI(MySQLEngineSpec):
23-
"""Amazon Aurora MySQL via the Data API.
24-
25-
Note: Documentation is in MySQLEngineSpec's compatible_databases section.
26-
This spec exists for runtime support of the auroradataapi driver.
27-
"""
26+
"""Amazon Aurora MySQL via the Data API."""
2827

2928
engine = "mysql"
3029
default_driver = "auroradataapi"
@@ -56,15 +55,21 @@ class AuroraMySQLDataAPI(MySQLEngineSpec):
5655
"secret_arn={secret_arn}&region_name={region_name}"
5756
),
5857
"default_port": 3306,
58+
"parameters": {
59+
"aws_access_id": "AWS Access Key ID",
60+
"aws_secret_access_key": "AWS Secret Access Key",
61+
"database_name": "Database name",
62+
"aurora_cluster_arn": "Aurora cluster ARN",
63+
"secret_arn": "Secrets Manager ARN for credentials",
64+
"region_name": "AWS region (e.g., us-east-1)",
65+
},
66+
"docs_url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/",
67+
"known_incompatibilities": AURORA_DATA_API_KNOWN_INCOMPATIBILITIES,
5968
}
6069

6170

6271
class AuroraPostgresDataAPI(PostgresEngineSpec):
63-
"""Amazon Aurora PostgreSQL via the Data API.
64-
65-
Note: Documentation is in PostgresEngineSpec's compatible_databases section.
66-
This spec exists for runtime support of the auroradataapi driver.
67-
"""
72+
"""Amazon Aurora PostgreSQL via the Data API."""
6873

6974
engine = "postgresql"
7075
default_driver = "auroradataapi"
@@ -96,6 +101,16 @@ class AuroraPostgresDataAPI(PostgresEngineSpec):
96101
"secret_arn={secret_arn}&region_name={region_name}"
97102
),
98103
"default_port": 5432,
104+
"parameters": {
105+
"aws_access_id": "AWS Access Key ID",
106+
"aws_secret_access_key": "AWS Secret Access Key",
107+
"database_name": "Database name",
108+
"aurora_cluster_arn": "Aurora cluster ARN",
109+
"secret_arn": "Secrets Manager ARN for credentials",
110+
"region_name": "AWS region (e.g., us-east-1)",
111+
},
112+
"docs_url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/",
113+
"known_incompatibilities": AURORA_DATA_API_KNOWN_INCOMPATIBILITIES,
99114
}
100115

101116

@@ -125,8 +140,16 @@ class AuroraMySQLEngineSpec(MySQLEngineSpec):
125140
DatabaseCategory.HOSTED_OPEN_SOURCE,
126141
],
127142
"pypi_packages": ["mysqlclient"],
128-
"connection_string": "mysql://{user}:{password}@{host}:{port}/{database}",
143+
"connection_string": "mysql://{username}:{password}@{host}:{port}/{database}",
129144
"default_port": 3306,
145+
"parameters": {
146+
"username": "Database username",
147+
"password": "Database password",
148+
"host": "Aurora cluster endpoint",
149+
"port": "Default 3306",
150+
"database": "Database name",
151+
},
152+
"docs_url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/",
130153
}
131154

132155

@@ -156,6 +179,14 @@ class AuroraPostgresEngineSpec(PostgresEngineSpec):
156179
DatabaseCategory.HOSTED_OPEN_SOURCE,
157180
],
158181
"pypi_packages": ["psycopg2"],
159-
"connection_string": "postgresql://{user}:{password}@{host}:{port}/{database}",
182+
"connection_string": "postgresql://{username}:{password}@{host}:{port}/{database}",
160183
"default_port": 5432,
184+
"parameters": {
185+
"username": "Database username",
186+
"password": "Database password",
187+
"host": "Aurora cluster endpoint",
188+
"port": "Default 5432",
189+
"database": "Database name",
190+
},
191+
"docs_url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/",
161192
}

‎superset/db_engine_specs/clickhouse.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ class ClickHouseEngineSpec(ClickHouseBaseEngineSpec):
338338
"pypi_packages": ["clickhouse-sqlalchemy"],
339339
"connection_string": "clickhouse://{username}:{password}@{host}:{port}/{database}",
340340
"default_port": 8123,
341+
"docs_url": "https://clickhouse.com/docs/",
342+
"sqlalchemy_docs_url": "https://github.com/xzkostyan/clickhouse-sqlalchemy",
341343
}
342344

343345
@classmethod
@@ -482,6 +484,10 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
482484
"logo": "clickhouse.svg",
483485
"logo_dark": "clickhouse-dark.svg",
484486
"homepage_url": "https://clickhouse.com/",
487+
"sqlalchemy_docs_url": (
488+
"https://clickhouse.com/docs/integrations/connectors/"
489+
"data-visualization/superset-and-clickhouse"
490+
),
485491
"categories": [
486492
DatabaseCategory.ANALYTICAL_DATABASES,
487493
DatabaseCategory.OPEN_SOURCE,
@@ -551,7 +557,10 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
551557
'echo "clickhouse-connect>=1.8.0,<2.0" >> ./docker/requirements-local.txt\n'
552558
"# Restart the containers after adding the driver."
553559
),
554-
"docs_url": "https://clickhouse.com/docs/integrations/superset",
560+
"docs_url": (
561+
"https://clickhouse.com/docs/integrations/connectors/"
562+
"data-visualization/superset-and-clickhouse"
563+
),
555564
"notes": (
556565
"The SQL playground at sql.clickhouse.com uses the database endpoint "
557566
"sql-clickhouse.clickhouse.com; the example connects to its uk sample "

‎superset/db_engine_specs/databricks.py‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ class DatabricksODBCEngineSpec(DatabricksBaseEngineSpec):
15161516
DatabaseCategory.ANALYTICAL_DATABASES,
15171517
DatabaseCategory.PROPRIETARY,
15181518
],
1519-
"pypi_packages": ["pyodbc"],
1519+
"pypi_packages": ["databricks-dbapi[odbc]", "pyodbc"],
15201520
"connection_string": (
15211521
"databricks+pyodbc://token:{access_token}@{host}:{port}/{database}?http_path={http_path}"
15221522
),
@@ -1528,6 +1528,17 @@ class DatabricksODBCEngineSpec(DatabricksBaseEngineSpec):
15281528
"database": "Database name",
15291529
"http_path": "HTTP path from SQL endpoint settings",
15301530
},
1531+
"known_incompatibilities": [
1532+
{
1533+
"dependency": "SQLAlchemy 2.0",
1534+
"reason": (
1535+
"databricks-dbapi pins sqlalchemy>=1.3,<2.0; no SQLAlchemy 2.0 "
1536+
"support is planned for the legacy driver. Use the Databricks "
1537+
"Python Connector (databricks-sql-connector) instead."
1538+
),
1539+
"tracking_url": "https://github.com/crflynn/databricks-dbapi",
1540+
}
1541+
],
15311542
}
15321543

15331544
# Note: Primary metadata is in DatabricksPythonConnectorEngineSpec which
@@ -1560,7 +1571,7 @@ class DatabricksHiveEngineSpec(SparkSqlBooleanEqualityMixin, HiveEngineSpec):
15601571
DatabaseCategory.ANALYTICAL_DATABASES,
15611572
DatabaseCategory.HOSTED_OPEN_SOURCE,
15621573
],
1563-
"pypi_packages": ["pyhive"],
1574+
"pypi_packages": ["databricks-dbapi[hive]", "pyhive", "thrift"],
15641575
"connection_string": (
15651576
"databricks+pyhive://token:{access_token}@{host}:{port}/{database}?http_path={http_path}"
15661577
),
@@ -1572,6 +1583,17 @@ class DatabricksHiveEngineSpec(SparkSqlBooleanEqualityMixin, HiveEngineSpec):
15721583
"database": "Database name",
15731584
"http_path": "HTTP path from cluster settings",
15741585
},
1586+
"known_incompatibilities": [
1587+
{
1588+
"dependency": "SQLAlchemy 2.0",
1589+
"reason": (
1590+
"databricks-dbapi pins sqlalchemy>=1.3,<2.0; no SQLAlchemy 2.0 "
1591+
"support is planned for the legacy driver. Use the Databricks "
1592+
"Python Connector (databricks-sql-connector) instead."
1593+
),
1594+
"tracking_url": "https://github.com/crflynn/databricks-dbapi",
1595+
}
1596+
],
15751597
}
15761598

15771599
# Note: Primary metadata is in DatabricksPythonConnectorEngineSpec which

‎superset/db_engine_specs/ibmi.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121

2222

2323
class IBMiEngineSpec(Db2EngineSpec):
24-
"""IBM Db2 for i (AS/400) engine spec.
25-
26-
Note: Documentation is in Db2EngineSpec's compatible_databases section.
27-
This spec exists for runtime support of the ibmi driver.
28-
"""
24+
"""IBM Db2 for i (AS/400) engine spec."""
2925

3026
engine = "ibmi"
3127
engine_name = "IBM Db2 for i"
@@ -48,7 +44,7 @@ class IBMiEngineSpec(Db2EngineSpec):
4844
"username": "IBM i user profile",
4945
"password": "User password",
5046
"host": "Hostname or IP address",
51-
"database": "Library/schema name",
47+
"database": "RDB name",
5248
},
5349
"docs_url": "https://github.com/IBM/sqlalchemy-ibmi",
5450
"sqlalchemy_docs_url": "https://github.com/IBM/sqlalchemy-ibmi",

‎superset/db_engine_specs/kusto.py‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,24 +209,16 @@ def convert_dttm(
209209

210210

211211
class KustoKqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
212-
"""Azure Data Explorer engine spec using native KQL query language.
213-
214-
Note: Documentation is consolidated in KustoSqlEngineSpec (Azure Data Explorer).
215-
This spec exists for runtime support of the kustokql driver.
216-
"""
212+
"""Azure Data Explorer engine spec using native KQL query language."""
217213

218214
engine = "kustokql"
219215
engine_name = "Azure Data Explorer (KQL)"
220216
time_groupby_inline = True
221-
allows_joins = True
222-
allows_subqueries = True
223-
allows_sql_comments = False
224-
run_multiple_statements_as_one = True
225217

226218
metadata = {
227219
"description": (
228220
"Azure Data Explorer (Kusto) using native Kusto Query Language (KQL) "
229-
"for high-performance log and telemetry analytics."
221+
"for fast, exploratory telemetry and log analytics."
230222
),
231223
"logo": "kusto.png",
232224
"homepage_url": "https://azure.microsoft.com/en-us/products/data-explorer/",
@@ -249,7 +241,24 @@ class KustoKqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
249241
"client_secret": "Azure AD application secret",
250242
"tenant_id": "Azure AD tenant ID",
251243
},
244+
"docs_url": "https://learn.microsoft.com/en-us/azure/data-explorer/",
245+
"sqlalchemy_docs_url": "https://github.com/dodopizza/sqlalchemy-kusto",
246+
"known_incompatibilities": [
247+
{
248+
"dependency": "SQLAlchemy 2.0",
249+
"reason": (
250+
"setup.py on the sqlalchemy-kusto main branch hard-pins "
251+
"sqlalchemy==1.4.*; no SQLAlchemy 2.0 work has started."
252+
),
253+
"tracking_url": "https://github.com/dodopizza/sqlalchemy-kusto",
254+
"since": "2026-10-27",
255+
}
256+
],
252257
}
258+
allows_joins = True
259+
allows_subqueries = True
260+
allows_sql_comments = False
261+
run_multiple_statements_as_one = True
253262

254263
_time_grain_expressions = {
255264
None: "{col}",

0 commit comments

Comments
 (0)