diff --git a/superset/app.py b/superset/app.py index dbc7859175..98381977a9 100644 --- a/superset/app.py +++ b/superset/app.py @@ -411,24 +411,26 @@ class SupersetAppInitializer: appbuilder.add_view_no_menu(DruidMetricInlineView) appbuilder.add_view_no_menu(DruidColumnInlineView) appbuilder.add_view_no_menu(Druid) - appbuilder.add_link( - "Scan New Datasources", - label=__("Scan New Datasources"), - href="/druid/scan_new_datasources/", - category="Sources", - category_label=__("Sources"), - category_icon="fa-database", - icon="fa-refresh", - ) - appbuilder.add_link( - "Refresh Druid Metadata", - label=__("Refresh Druid Metadata"), - href="/druid/refresh_datasources/", - category="Sources", - category_label=__("Sources"), - category_icon="fa-database", - icon="fa-cog", - ) + + if self.config["DRUID_METADATA_LINKS_ENABLED"]: + appbuilder.add_link( + "Scan New Datasources", + label=__("Scan New Datasources"), + href="/druid/scan_new_datasources/", + category="Sources", + category_label=__("Sources"), + category_icon="fa-database", + icon="fa-refresh", + ) + appbuilder.add_link( + "Refresh Druid Metadata", + label=__("Refresh Druid Metadata"), + href="/druid/refresh_datasources/", + category="Sources", + category_label=__("Sources"), + category_icon="fa-database", + icon="fa-cog", + ) appbuilder.add_separator("Sources") def init_app_in_ctx(self) -> None: diff --git a/superset/config.py b/superset/config.py index c4fc40e1bd..b58907d19c 100644 --- a/superset/config.py +++ b/superset/config.py @@ -191,12 +191,17 @@ FAB_API_SWAGGER_UI = True DRUID_TZ = tz.tzutc() DRUID_ANALYSIS_TYPES = ["cardinality"] -# Legacy Druid connector +# Legacy Druid NoSQL (native) connector # Druid supports a SQL interface in its newer versions. # Setting this flag to True enables the deprecated, API-based Druid # connector. This feature may be removed at a future date. DRUID_IS_ACTIVE = False +# If Druid is active whether to include the links to scan/refresh Druid datasources. +# This should be disabled if you are trying to wean yourself off of the Druid NoSQL +# connector. +DRUID_METADATA_LINKS_ENABLED = True + # ---------------------------------------------------- # AUTHENTICATION CONFIG # ----------------------------------------------------