You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/14 05:37:06 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #11233: chore(engine): adapt postgres backend connection URI

villebro commented on a change in pull request #11233:
URL: https://github.com/apache/incubator-superset/pull/11233#discussion_r504411667



##########
File path: superset/db_engine_specs/__init__.py
##########
@@ -36,6 +36,7 @@
 from superset.db_engine_specs.base import BaseEngineSpec
 
 engines: Dict[str, Type[BaseEngineSpec]] = {}
+_translates: Dict[str, str] = {"postgres": "postgresql"}

Review comment:
       Good idea! Let's add a property `BaseEngineSpecs.aliases: List[str] = []` (I'm open to naming suggestions, perhaps 'engine_aliases' might be even more descriptive). This way we can then override this in `PostgresEngineSpec` by defining `aliases = ["postgres"]`.

##########
File path: superset/db_engine_specs/__init__.py
##########
@@ -49,3 +50,6 @@
             and attribute.engine != ""
         ):
             engines[attribute.engine] = attribute
+            if attribute.engine in _translates:
+                _dialect = _translates[attribute.engine]
+                engines[_dialect] = attribute

Review comment:
       ..Here we can then do a loop over the aliases, mapping them to the original engine class.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org