Skip to content

Commit

Permalink
Be able to lookup driver by engine alias (#16800)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnzhu authored Sep 24, 2021
1 parent c933250 commit 0d064f4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion superset/db_engine_specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ def get_available_engine_specs() -> Dict[Type[BaseEngineSpec], Set[str]]:

available_engines = {}
for engine_spec in load_engine_specs():
available_engines[engine_spec] = drivers[engine_spec.engine]
driver = drivers[engine_spec.engine]

# lookup driver by engine aliases.
if not driver and engine_spec.engine_aliases:
for alias in engine_spec.engine_aliases:
driver = drivers[alias]
if driver:
break

available_engines[engine_spec] = driver

return available_engines

0 comments on commit 0d064f4

Please sign in to comment.