Skip to content

Commit

Permalink
Be able to lookup driver by engine alias (apache#16800)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnzhu authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent e913f90 commit f5dd0b9
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 f5dd0b9

Please sign in to comment.