Antonio-RiveroMartnez commented on code in PR #21486:
URL: https://github.com/apache/superset/pull/21486#discussion_r978017174
##########
superset/db_engine_specs/__init__.py:
##########
@@ -170,6 +170,17 @@ def get_available_engine_specs() ->
Dict[Type[BaseEngineSpec], Set[str]]:
for engine_spec in load_engine_specs():
driver = drivers[engine_spec.engine]
+ # do not add denied db engine specs to available list
+ dbs_denylist = app.config["DBS_AVAILABLE_DENYLIST"]
+ dbs_denylist_engines = dbs_denylist.keys()
+
+ if (
+ engine_spec.engine in dbs_denylist_engines
+ and hasattr(engine_spec, "default_driver")
+ and engine_spec.default_driver in dbs_denylist[engine_spec.engine]
Review Comment:
Curious, why just checking if the `default_driver` is in the list and not
any other that engine might have?
##########
superset/config.py:
##########
@@ -1102,6 +1103,13 @@ def EMAIL_HEADER_MUTATOR( # pylint:
disable=invalid-name,unused-argument
return msg
+# For database connections, this dictionary will remove engines from the
available
+# list/dropdown if you do not want these dbs to show as available.
+# The available list is generated by driver installed, and some drivers have
multiple
Review Comment:
Should this say `some engines have multiple drivers`? Based on for example `
{"databricks": ("pyhive", "pyodbc")}` seems like it's a single engine
`databricks` the one with multiple drivers `pyhive` & `pyodbc` ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]