From b06ab7d8e3a19c13690ebc99480a9f1a2392447d Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:03:03 -0300 Subject: [PATCH] refactor: Removes the deprecated ENABLE_TEMPLATE_REMOVE_FILTERS feature flag (#26345) --- RESOURCES/FEATURE_FLAGS.md | 1 - UPDATING.md | 1 + .../packages/superset-ui-core/src/utils/featureFlags.ts | 1 - superset/config.py | 1 - superset/models/helpers.py | 7 +++---- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index bfd78bbb74..4a078d6325 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -88,7 +88,6 @@ These features flags currently default to True and **will be removed in a future - DASHBOARD_NATIVE_FILTERS - ENABLE_EXPLORE_JSON_CSRF_PROTECTION - ENABLE_JAVASCRIPT_CONTROLS -- ENABLE_TEMPLATE_REMOVE_FILTERS - GENERIC_CHART_AXES - KV_STORE - VERSIONED_EXPORT diff --git a/UPDATING.md b/UPDATING.md index f8e5b3149c..ccafa2c5c4 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -30,6 +30,7 @@ assists people when migrating to a new version. ### Breaking Changes +- [26345](https://github.com/apache/superset/issues/26345): Removes the deprecated `ENABLE_TEMPLATE_REMOVE_FILTERS` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled. - [26346](https://github.com/apache/superset/issues/26346): Removes the deprecated `REMOVE_SLICE_LEVEL_LABEL_COLORS` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. - [26348](https://github.com/apache/superset/issues/26348): Removes the deprecated `CLIENT_CACHE` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. - [26349](https://github.com/apache/superset/issues/26349): Removes the deprecated `DASHBOARD_CACHE` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index cedc4064be..b2001ec4c1 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -44,7 +44,6 @@ export enum FeatureFlag { /** @deprecated */ ENABLE_JAVASCRIPT_CONTROLS = 'ENABLE_JAVASCRIPT_CONTROLS', ENABLE_TEMPLATE_PROCESSING = 'ENABLE_TEMPLATE_PROCESSING', - ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS', ESCAPE_MARKDOWN_HTML = 'ESCAPE_MARKDOWN_HTML', ESTIMATE_QUERY_COST = 'ESTIMATE_QUERY_COST', GENERIC_CHART_AXES = 'GENERIC_CHART_AXES', diff --git a/superset/config.py b/superset/config.py index cd78ef3729..3999edb35a 100644 --- a/superset/config.py +++ b/superset/config.py @@ -418,7 +418,6 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = { # See `PR 7935 `_ for more details. "ENABLE_EXPLORE_JSON_CSRF_PROTECTION": False, # deprecated "ENABLE_TEMPLATE_PROCESSING": False, - "ENABLE_TEMPLATE_REMOVE_FILTERS": True, # deprecated # Allow for javascript controls components # this enables programmers to customize certain charts (like the # geospatial ones) by inputting javascript in controls. This exposes diff --git a/superset/models/helpers.py b/superset/models/helpers.py index d64b9036a4..2c56c41b90 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -1760,10 +1760,9 @@ class ExploreMixin: # pylint: disable=too-many-public-methods col_obj = columns_by_name.get(cast(str, flt_col)) filter_grain = flt.get("grain") - if is_feature_enabled("ENABLE_TEMPLATE_REMOVE_FILTERS"): - if get_column_name(flt_col) in removed_filters: - # Skip generating SQLA filter when the jinja template handles it. - continue + if get_column_name(flt_col) in removed_filters: + # Skip generating SQLA filter when the jinja template handles it. + continue if col_obj or sqla_col is not None: if sqla_col is not None: