From 2af76fc41f06516f7df0e3dc05e8149b1f1febd4 Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Mon, 8 May 2023 14:12:39 -0700 Subject: [PATCH] fix: MySQL et al. super calls (#23971) --- superset/db_engine_specs/mysql.py | 10 +++++++--- superset/db_engine_specs/ocient.py | 4 +--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/superset/db_engine_specs/mysql.py b/superset/db_engine_specs/mysql.py index 9c5bd0034a..110d127e2a 100644 --- a/superset/db_engine_specs/mysql.py +++ b/superset/db_engine_specs/mysql.py @@ -205,9 +205,13 @@ class MySQLEngineSpec(BaseEngineSpec, BasicParametersMixin): catalog: Optional[str] = None, schema: Optional[str] = None, ) -> Tuple[URL, Dict[str, Any]]: - uri, new_connect_args = super( - MySQLEngineSpec, MySQLEngineSpec - ).adjust_engine_params(uri, connect_args, catalog, schema) + uri, new_connect_args = super().adjust_engine_params( + uri, + connect_args, + catalog, + schema, + ) + if schema: uri = uri.set(database=parse.quote(schema, safe="")) diff --git a/superset/db_engine_specs/ocient.py b/superset/db_engine_specs/ocient.py index 87bd2c2422..5413ad9e13 100644 --- a/superset/db_engine_specs/ocient.py +++ b/superset/db_engine_specs/ocient.py @@ -261,9 +261,7 @@ class OcientEngineSpec(BaseEngineSpec): cls, cursor: Any, limit: Optional[int] = None ) -> List[Tuple[Any, ...]]: try: - rows: List[Tuple[Any, ...]] = super(OcientEngineSpec, cls).fetch_data( - cursor, limit - ) + rows: List[Tuple[Any, ...]] = super().fetch_data(cursor, limit) except Exception as exception: with OcientEngineSpec.query_id_mapping_lock: del OcientEngineSpec.query_id_mapping[