aminghadersohi commented on code in PR #44736:
URL: https://github.com/apache/superset/pull/44736#discussion_r4140699509
##########
superset/db_engine_specs/doris.py:
##########
@@ -112,7 +113,10 @@ class DorisEngineSpec(MySQLEngineSpec):
engine_aliases = {"doris"}
engine_name = "Apache Doris"
max_column_name_length = 64
- default_driver = "pydoris"
+ # pydoris registers its dialect (a ``MySQLDialect_mysqldb`` subclass) as
+ # ``doris`` and ``pydoris``, so the installed driver is ``mysqldb``. The
+ # connection form is only offered when ``default_driver`` is installed.
+ default_driver = "mysqldb"
Review Comment:
Pulled the `encryption_parameters` fix in here in 43e385bce7 rather than
waiting on #44718: the switch now sets `ssl_mode=VERIFY_CA` (the same value
#44718 uses, verified there against Doris 4.1.3 with mysqlclient/MariaDB
Connector/C), so it requires TLS instead of sending `ssl=0`. The
`encryption=True` test case now asserts that mysqlclient's connect kwargs carry
`ssl_mode=VERIFY_CA` and no `ssl` key, and that it still round-trips as
encrypted. The normalization of saved `ssl=1` / `REQUIRED` URLs stays in #44718.
##########
superset/db_engine_specs/doris.py:
##########
@@ -278,6 +282,21 @@ class DorisEngineSpec(MySQLEngineSpec):
),
}
+ @classmethod
+ def build_sqlalchemy_uri(
+ cls,
+ parameters: BasicParametersType,
+ encrypted_extra: Optional[dict[str, str]] = None,
+ ) -> str:
+ uri = super().build_sqlalchemy_uri(parameters, encrypted_extra)
+ # ``engine+default_driver`` would be ``pydoris+mysqldb``, which no
+ # SQLAlchemy entry point provides; ``doris`` is the dialect's scheme.
+ return (
+ make_url_safe(uri)
+ .set(drivername="doris")
+ .render_as_string(hide_password=False)
+ )
Review Comment:
Right, thanks. Fixed in 43e385bce7: `build_sqlalchemy_uri` now sets the
drivername to `cls.engine` (`pydoris`, which pydoris registers), and the test
asserts `make_url(uri).get_backend_name() == DorisEngineSpec.engine` alongside
resolving the dialect.
--
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]