From 2ac42ef3d475efa0f80af427cf7637ea20b99d3b Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Fri, 22 Dec 2023 09:52:47 -0300 Subject: [PATCH 1/2] refactor: Removes the ENABLE_TEMPLATE_REMOVE_FILTERS feature flag --- RESOURCES/FEATURE_FLAGS.md | 1 - UPDATING.md | 2 ++ .../packages/superset-ui-core/src/utils/featureFlags.ts | 1 - superset/config.py | 1 - superset/models/helpers.py | 7 +++---- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index d029ca6c3cbd6..3838ef07b272f 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -94,7 +94,6 @@ These features flags currently default to True and **will be removed in a future - DISABLE_DATASET_SOURCE_EDIT - ENABLE_EXPLORE_DRAG_AND_DROP - ENABLE_EXPLORE_JSON_CSRF_PROTECTION -- ENABLE_TEMPLATE_REMOVE_FILTERS - GENERIC_CHART_AXES - REMOVE_SLICE_LEVEL_LABEL_COLORS - VERSIONED_EXPORT diff --git a/UPDATING.md b/UPDATING.md index b5c48924b727e..a9609a35fb844 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,6 +29,8 @@ 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. + ### Potential Downtime ### Other 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 6bc77e0e87a1a..bcfffff672de5 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -45,7 +45,6 @@ export enum FeatureFlag { ENABLE_EXPLORE_DRAG_AND_DROP = 'ENABLE_EXPLORE_DRAG_AND_DROP', 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 348baef5454af..3e0b7520a4171 100644 --- a/superset/config.py +++ b/superset/config.py @@ -421,7 +421,6 @@ class D3Format(TypedDict, total=False): # 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 d64b9036a49be..2c56c41b904df 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -1760,10 +1760,9 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma 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: From c498033d1d7bfcb906789841bef1686bbb2a5ad2 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:44:41 -0300 Subject: [PATCH 2/2] Update UPDATING.md --- UPDATING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING.md b/UPDATING.md index a9609a35fb844..73589ccfaa6c9 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,7 +29,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. +- [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. ### Potential Downtime