diff --git a/superset/databases/commands/validate.py b/superset/databases/commands/validate.py index 066c8a6c58084..e9fe5eaf0c972 100644 --- a/superset/databases/commands/validate.py +++ b/superset/databases/commands/validate.py @@ -44,7 +44,7 @@ def __init__(self, parameters: Dict[str, Any]): def run(self) -> None: engine = self._properties["engine"] - driver = self._properties["driver"] + driver = self._properties.get("driver") if engine in BYPASS_VALIDATION_ENGINES: # Skip engines that are only validated onCreate diff --git a/tests/integration_tests/databases/api_tests.py b/tests/integration_tests/databases/api_tests.py index 8ff12b2406b54..b53418fb16496 100644 --- a/tests/integration_tests/databases/api_tests.py +++ b/tests/integration_tests/databases/api_tests.py @@ -1425,7 +1425,7 @@ def test_test_connection_failed(self): expected_response = { "errors": [ { - "message": "Could not load database driver: AzureSynapseSpec", + "message": "Could not load database driver: MssqlEngineSpec", "error_type": "GENERIC_COMMAND_ERROR", "level": "warning", "extra": { diff --git a/tests/integration_tests/db_engine_specs/postgres_tests.py b/tests/integration_tests/db_engine_specs/postgres_tests.py index 17df25000b364..79a307a488515 100644 --- a/tests/integration_tests/db_engine_specs/postgres_tests.py +++ b/tests/integration_tests/db_engine_specs/postgres_tests.py @@ -137,7 +137,11 @@ def test_engine_alias_name(self): """ DB Eng Specs (postgres): Test "postgres" in engine spec """ - self.assertIn("postgres", [engine.engine for engine in load_engine_specs()]) + backends = set() + for engine in load_engine_specs(): + backends.add(engine.engine) + backends.update(engine.engine_aliases) + assert "postgres" in backends def test_extras_without_ssl(self): db = mock.Mock()