diff --git a/UPDATING.md b/UPDATING.md index 3b2e3e31949e6..5b4369114e28e 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -23,6 +23,8 @@ assists people when migrating to a new version. ## Next +* [10320](https://github.com/apache/incubator-superset/pull/10320): References to blacklst/whitelist language have been replaced with more appropriate alternatives. All configs refencing containing `WHITE`/`BLACK` have been replaced with `ALLOW`/`DENY`. Affected config variables that need to be updated: `TIME_GRAIN_BLACKLIST`, `VIZ_TYPE_BLACKLIST`, `DRUID_DATA_SOURCE_BLACKLIST`. + * [9964](https://github.com/apache/incubator-superset/pull/9964): Breaking change on Flask-AppBuilder 3. If you're using OAuth, find out what needs to be changed [here](https://github.com/dpgaspar/Flask-AppBuilder/blob/master/README.rst#change-log). * [10233](https://github.com/apache/incubator-superset/pull/10233): a change which deprecates the `ENABLE_FLASK_COMPRESS` config option in favor of the Flask-Compress `COMPRESS_REGISTER` config option which serves the same purpose. diff --git a/superset/config.py b/superset/config.py index 74e7fec7109c3..9ded3d17f0e9c 100644 --- a/superset/config.py +++ b/superset/config.py @@ -381,8 +381,8 @@ def _try_json_readsha( # pylint: disable=unused-argument # List of time grains to disable in the application (see list of builtin # time grains in superset/db_engine_specs.builtin_time_grains). # For example: to disable 1 second time grain: -# TIME_GRAIN_BLACKLIST = ['PT1S'] -TIME_GRAIN_BLACKLIST: List[str] = [] +# TIME_GRAIN_DENYLIST = ['PT1S'] +TIME_GRAIN_DENYLIST: List[str] = [] # Additional time grains to be supported using similar definitions as in # superset/db_engine_specs.builtin_time_grains. @@ -402,17 +402,17 @@ def _try_json_readsha( # pylint: disable=unused-argument # --------------------------------------------------- # List of viz_types not allowed in your environment -# For example: Blacklist pivot table and treemap: -# VIZ_TYPE_BLACKLIST = ['pivot_table', 'treemap'] +# For example: Disable pivot table and treemap: +# VIZ_TYPE_DENYLIST = ['pivot_table', 'treemap'] # --------------------------------------------------- -VIZ_TYPE_BLACKLIST: List[str] = [] +VIZ_TYPE_DENYLIST: List[str] = [] # --------------------------------------------------- # List of data sources not to be refreshed in druid cluster # --------------------------------------------------- -DRUID_DATA_SOURCE_BLACKLIST: List[str] = [] +DRUID_DATA_SOURCE_DENYLIST: List[str] = [] # -------------------------------------------------- # Modules, datasources and middleware to be registered diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index e9c6029e7720c..ffd178d7c0a2f 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -206,11 +206,11 @@ def refresh_datasources( If ``datasource_name`` is specified, only that datasource is updated """ ds_list = self.get_datasources() - blacklist = conf.get("DRUID_DATA_SOURCE_BLACKLIST", []) + denylist = conf.get("DRUID_DATA_SOURCE_DENYLIST", []) ds_refresh: List[str] = [] if not datasource_name: - ds_refresh = list(filter(lambda ds: ds not in blacklist, ds_list)) - elif datasource_name not in blacklist and datasource_name in ds_list: + ds_refresh = list(filter(lambda ds: ds not in denylist, ds_list)) + elif datasource_name not in denylist and datasource_name in ds_list: ds_refresh.append(datasource_name) else: return diff --git a/superset/db_engine_specs/base.py b/superset/db_engine_specs/base.py index a32c21af8015e..881599015afac 100644 --- a/superset/db_engine_specs/base.py +++ b/superset/db_engine_specs/base.py @@ -268,7 +268,7 @@ def get_time_grains(cls) -> Tuple[TimeGrain, ...]: def get_time_grain_expressions(cls) -> Dict[Optional[str], str]: """ Return a dict of all supported time grains including any potential added grains - but excluding any potentially blacklisted grains in the config file. + but excluding any potentially disabled grains in the config file. :return: All time grain expressions supported by the engine """ @@ -276,8 +276,8 @@ def get_time_grain_expressions(cls) -> Dict[Optional[str], str]: time_grain_expressions = cls._time_grain_expressions.copy() grain_addon_expressions = config["TIME_GRAIN_ADDON_EXPRESSIONS"] time_grain_expressions.update(grain_addon_expressions.get(cls.engine, {})) - blacklist: List[str] = config["TIME_GRAIN_BLACKLIST"] - for key in blacklist: + denylist: List[str] = config["TIME_GRAIN_DENYLIST"] + for key in denylist: time_grain_expressions.pop(key) return time_grain_expressions diff --git a/superset/models/datasource_access_request.py b/superset/models/datasource_access_request.py index 8940611b5eceb..974633294b3fc 100644 --- a/superset/models/datasource_access_request.py +++ b/superset/models/datasource_access_request.py @@ -42,7 +42,7 @@ class DatasourceAccessRequest(Model, AuditMixinNullable): datasource_id = Column(Integer) datasource_type = Column(String(200)) - ROLES_BLACKLIST = set(config["ROBOT_PERMISSION_ROLES"]) + ROLES_DENYLIST = set(config["ROBOT_PERMISSION_ROLES"]) @property def cls_model(self) -> Type["BaseDatasource"]: @@ -72,7 +72,7 @@ def roles_with_datasource(self) -> str: perm = self.datasource.perm # pylint: disable=no-member pv = security_manager.find_permission_view_menu("datasource_access", perm) for role in pv.role: - if role.name in self.ROLES_BLACKLIST: + if role.name in self.ROLES_DENYLIST: continue # pylint: disable=no-member href = ( @@ -95,7 +95,7 @@ def user_roles(self) -> str: f"created_by={self.created_by.username}&role_to_extend={role.name}" ) link = 'Extend {} Role'.format(href, role.name) - if role.name in self.ROLES_BLACKLIST: + if role.name in self.ROLES_DENYLIST: link = "{} Role".format(role.name) action_list = action_list + "