Skip to content

Commit 7fccea1

Browse files
refactor: Removes the deprecated CLIENT_CACHE feature flag (#26348)
1 parent 7ab37d2 commit 7fccea1

File tree

8 files changed

+32
-99
lines changed

8 files changed

+32
-99
lines changed

RESOURCES/FEATURE_FLAGS.md

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ These features flags currently default to True and **will be removed in a future
8585

8686
[//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY"
8787

88-
- CLIENT_CACHE
8988
- DASHBOARD_FILTERS_EXPERIMENTAL
9089
- DASHBOARD_NATIVE_FILTERS
9190
- ENABLE_EXPLORE_JSON_CSRF_PROTECTION

UPDATING.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ assists people when migrating to a new version.
3131

3232
### Breaking Changes
3333

34+
- [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.
3435
- [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.
3536
- [26369](https://github.com/apache/superset/issues/26369): Removes the Filter Sets feature including the deprecated `DASHBOARD_NATIVE_FILTERS_SET` feature flag and all related API endpoints. The feature is permanently removed as it was not being actively maintained, it was not widely used, and it was full of bugs. We also considered that if we were to provide a similar feature, it would be better to re-implement it from scratch given the amount of technical debt that the current implementation has. The previous value of the feature flag was `False` and now the feature is permanently removed.
3637
- [26343](https://github.com/apache/superset/issues/26343): Removes the deprecated `ENABLE_EXPLORE_DRAG_AND_DROP` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled.

docs/docs/installation/configuring-superset.mdx

+17-17
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,27 @@ version: 1
99

1010
### Configuration
1111

12-
To configure your application, you need to create a file `superset_config.py`. Add this file to your
12+
To configure your application, you need to create a file `superset_config.py`. Add this file to your
1313

1414
`PYTHONPATH` or create an environment variable `SUPERSET_CONFIG_PATH` specifying the full path of the `superset_config.py`.
1515

1616
For example, if deploying on Superset directly on a Linux-based system where your `superset_config.py` is under `/app` directory, you can run:
17+
1718
```bash
1819
export SUPERSET_CONFIG_PATH=/app/superset_config.py
1920
```
2021

2122
If you are using your own custom Dockerfile with official Superset image as base image, then you can add your overrides as shown below:
23+
2224
```bash
2325
COPY --chown=superset superset_config.py /app/
2426
ENV SUPERSET_CONFIG_PATH /app/superset_config.py
2527
```
2628

27-
Docker compose deployments handle application configuration differently. See [https://github.com/apache/superset/tree/master/docker#readme](https://github.com/apache/superset/tree/master/docker#readme) for details.
29+
Docker compose deployments handle application configuration differently. See [https://github.com/apache/superset/tree/master/docker#readme](https://github.com/apache/superset/tree/master/docker#readme) for details.
2830

2931
The following is an example of just a few of the parameters you can set in your `superset_config.py` file:
32+
3033
```
3134
# Superset specific config
3235
ROW_LIMIT = 5000
@@ -88,7 +91,7 @@ WTF_CSRF_EXEMPT_LIST = [‘’]
8891

8992
#### Adding an initial SECRET_KEY
9093

91-
Superset requires a user-specified SECRET_KEY to start up. This requirement was [added in version 2.1.0 to force secure configurations](https://preset.io/blog/superset-security-update-default-secret_key-vulnerability/). Add a strong SECRET_KEY to your `superset_config.py` file like:
94+
Superset requires a user-specified SECRET_KEY to start up. This requirement was [added in version 2.1.0 to force secure configurations](https://preset.io/blog/superset-security-update-default-secret_key-vulnerability/). Add a strong SECRET_KEY to your `superset_config.py` file like:
9295

9396
```python
9497
SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY'
@@ -99,7 +102,7 @@ You can generate a strong secure key with `openssl rand -base64 42`.
99102
#### Rotating to a newer SECRET_KEY
100103

101104
If you wish to change your existing SECRET_KEY, add the existing SECRET_KEY to your `superset_config.py` file as
102-
`PREVIOUS_SECRET_KEY = `and provide your new key as `SECRET_KEY =`. You can find your current SECRET_KEY with these
105+
`PREVIOUS_SECRET_KEY = `and provide your new key as `SECRET_KEY =`. You can find your current SECRET_KEY with these
103106
commands - if running Superset with Docker, execute from within the Superset application container:
104107

105108
```python
@@ -119,23 +122,21 @@ database engine on a separate host or container.
119122

120123
Superset supports the following database engines/versions:
121124

122-
| Database Engine | Supported Versions |
123-
| --------------------------------------------------------- | ---------------------------------- |
124-
| [PostgreSQL](https://www.postgresql.org/) | 10.X, 11.X, 12.X, 13.X, 14.X, 15.X |
125-
| [MySQL](https://www.mysql.com/) | 5.7, 8.X |
126-
125+
| Database Engine | Supported Versions |
126+
| ----------------------------------------- | ---------------------------------- |
127+
| [PostgreSQL](https://www.postgresql.org/) | 10.X, 11.X, 12.X, 13.X, 14.X, 15.X |
128+
| [MySQL](https://www.mysql.com/) | 5.7, 8.X |
127129

128130
Use the following database drivers and connection strings:
129131

130-
| Database | PyPI package | Connection String |
131-
| ----------------------------------------- | --------------------------------- | ------------------------------------------------------------------------ |
132-
| [PostgreSQL](https://www.postgresql.org/) | `pip install psycopg2` | `postgresql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
133-
| [MySQL](https://www.mysql.com/) | `pip install mysqlclient` | `mysql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
132+
| Database | PyPI package | Connection String |
133+
| ----------------------------------------- | ------------------------- | ---------------------------------------------------------------------- |
134+
| [PostgreSQL](https://www.postgresql.org/) | `pip install psycopg2` | `postgresql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
135+
| [MySQL](https://www.mysql.com/) | `pip install mysqlclient` | `mysql://<UserName>:<DBPassword>@<Database Host>/<Database Name>` |
134136

135137
To configure Superset metastore set `SQLALCHEMY_DATABASE_URI` config key on `superset_config`
136138
to the appropriate connection string.
137139

138-
139140
### Running on a WSGI HTTP Server
140141

141142
While you can run Superset on NGINX or Apache, we recommend using Gunicorn in async mode. This
@@ -167,7 +168,7 @@ So, when you use `BigQuery` datasource on Superset, you have to use `gunicorn` w
167168

168169
### HTTPS Configuration
169170

170-
You can configure HTTPS upstream via a load balancer or a reverse proxy (such as nginx) and do SSL/TLS Offloading before traffic reaches the Superset application. In this setup, local traffic from a Celery worker taking a snapshot of a chart for Alerts & Reports can access Superset at a `http://` URL, from behind the ingress point.
171+
You can configure HTTPS upstream via a load balancer or a reverse proxy (such as nginx) and do SSL/TLS Offloading before traffic reaches the Superset application. In this setup, local traffic from a Celery worker taking a snapshot of a chart for Alerts & Reports can access Superset at a `http://` URL, from behind the ingress point.
171172
You can also configure [SSL in Gunicorn](https://docs.gunicorn.org/en/stable/settings.html#ssl) (the Python webserver) if you are using an official Superset Docker image.
172173

173174
### Configuration Behind a Load Balancer
@@ -191,7 +192,7 @@ RequestHeader set X-Forwarded-Proto "https"
191192
### Custom OAuth2 Configuration
192193

193194
Superset is built on Flask-AppBuilder (FAB), which supports many providers out of the box
194-
(GitHub, Twitter, LinkedIn, Google, Azure, etc). Beyond those, Superset can be configured to connect
195+
(GitHub, Twitter, LinkedIn, Google, Azure, etc). Beyond those, Superset can be configured to connect
195196
with other OAuth2 Authorization Server implementations that support “code” authorization.
196197

197198
Make sure the pip package [`Authlib`](https://authlib.org/) is installed on the webserver.
@@ -357,7 +358,6 @@ You can enable or disable features with flag from `superset_config.py`:
357358

358359
```python
359360
FEATURE_FLAGS = {
360-
'CLIENT_CACHE': False,
361361
'ENABLE_EXPLORE_JSON_CSRF_PROTECTION': False,
362362
'PRESTO_EXPAND_DATA': False,
363363
}

superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export enum FeatureFlag {
2525
ALERTS_ATTACH_REPORTS = 'ALERTS_ATTACH_REPORTS',
2626
ALERT_REPORTS = 'ALERT_REPORTS',
2727
ALLOW_FULL_CSV_EXPORT = 'ALLOW_FULL_CSV_EXPORT',
28-
CLIENT_CACHE = 'CLIENT_CACHE',
2928
DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS',
3029
DASHBOARD_FILTERS_EXPERIMENTAL = 'DASHBOARD_FILTERS_EXPERIMENTAL',
3130
CONFIRM_DASHBOARD_DIFF = 'CONFIRM_DASHBOARD_DIFF',

superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ it('initializes feature flags with predefined values', () => {
3131
value: undefined,
3232
});
3333
const featureFlags = {
34-
CLIENT_CACHE: true,
3534
DRILL_BY: false,
3635
};
3736
uiCore.initFeatureFlags(featureFlags);
@@ -67,10 +66,8 @@ it('returns false for unset feature flag', () => {
6766
it('returns true for set feature flag', () => {
6867
Object.defineProperty(window, 'featureFlags', {
6968
value: {
70-
CLIENT_CACHE: true,
69+
DRILL_BY: true,
7170
},
7271
});
73-
expect(uiCore.isFeatureEnabled(uiCore.FeatureFlag.CLIENT_CACHE)).toEqual(
74-
true,
75-
);
72+
expect(uiCore.isFeatureEnabled(uiCore.FeatureFlag.DRILL_BY)).toEqual(true);
7673
});

superset-frontend/src/components/Chart/Chart.jsx

+9-21
Original file line numberDiff line numberDiff line change
@@ -155,27 +155,15 @@ class Chart extends React.PureComponent {
155155
}
156156

157157
runQuery() {
158-
if (this.props.chartId > 0 && isFeatureEnabled(FeatureFlag.CLIENT_CACHE)) {
159-
// Load saved chart with a GET request
160-
this.props.actions.getSavedChart(
161-
this.props.formData,
162-
this.props.force || getUrlParam(URL_PARAMS.force), // allow override via url params force=true
163-
this.props.timeout,
164-
this.props.chartId,
165-
this.props.dashboardId,
166-
this.props.ownState,
167-
);
168-
} else {
169-
// Create chart with POST request
170-
this.props.actions.postChartFormData(
171-
this.props.formData,
172-
Boolean(this.props.force || getUrlParam(URL_PARAMS.force)), // allow override via url params force=true
173-
this.props.timeout,
174-
this.props.chartId,
175-
this.props.dashboardId,
176-
this.props.ownState,
177-
);
178-
}
158+
// Create chart with POST request
159+
this.props.actions.postChartFormData(
160+
this.props.formData,
161+
Boolean(this.props.force || getUrlParam(URL_PARAMS.force)), // allow override via url params force=true
162+
this.props.timeout,
163+
this.props.chartId,
164+
this.props.dashboardId,
165+
this.props.ownState,
166+
);
179167
}
180168

181169
handleRenderContainerFailure(error, info) {

superset-frontend/src/components/Chart/chartAction.js

+3-52
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ const legacyChartDataRequest = async (
143143
parseMethod,
144144
};
145145

146-
const clientMethod =
147-
'GET' && isFeatureEnabled(FeatureFlag.CLIENT_CACHE)
148-
? SupersetClient.get
149-
: SupersetClient.post;
150-
return clientMethod(querySettings).then(({ json, response }) =>
146+
return SupersetClient.post(querySettings).then(({ json, response }) =>
151147
// Make the legacy endpoint return a payload that corresponds to the
152148
// V1 chart data endpoint response signature.
153149
({
@@ -379,7 +375,6 @@ export function exploreJSON(
379375
force = false,
380376
timeout = 60,
381377
key,
382-
method,
383378
dashboardId,
384379
ownState,
385380
) {
@@ -402,7 +397,7 @@ export function exploreJSON(
402397
resultFormat: 'json',
403398
resultType: 'full',
404399
force,
405-
method,
400+
method: 'POST',
406401
requestParams,
407402
ownState,
408403
});
@@ -518,36 +513,6 @@ export function exploreJSON(
518513
};
519514
}
520515

521-
export const GET_SAVED_CHART = 'GET_SAVED_CHART';
522-
export function getSavedChart(
523-
formData,
524-
force = false,
525-
timeout = 60,
526-
key,
527-
dashboardId,
528-
ownState,
529-
) {
530-
/*
531-
* Perform a GET request to `/explore_json`.
532-
*
533-
* This will return the payload of a saved chart, optionally filtered by
534-
* ad-hoc or extra filters from dashboards. Eg:
535-
*
536-
* GET /explore_json?{"chart_id":1}
537-
* GET /explore_json?{"chart_id":1,"extra_filters":"..."}
538-
*
539-
*/
540-
return exploreJSON(
541-
formData,
542-
force,
543-
timeout,
544-
key,
545-
'GET',
546-
dashboardId,
547-
ownState,
548-
);
549-
}
550-
551516
export const POST_CHART_FORM_DATA = 'POST_CHART_FORM_DATA';
552517
export function postChartFormData(
553518
formData,
@@ -557,21 +522,7 @@ export function postChartFormData(
557522
dashboardId,
558523
ownState,
559524
) {
560-
/*
561-
* Perform a POST request to `/explore_json`.
562-
*
563-
* This will post the form data to the endpoint, returning a new chart.
564-
*
565-
*/
566-
return exploreJSON(
567-
formData,
568-
force,
569-
timeout,
570-
key,
571-
'POST',
572-
dashboardId,
573-
ownState,
574-
);
525+
return exploreJSON(formData, force, timeout, key, dashboardId, ownState);
575526
}
576527

577528
export function redirectSQLLab(formData, history) {

superset/config.py

-2
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,6 @@ class D3Format(TypedDict, total=False):
402402
# and FEATURE_FLAGS = { 'BAR': True, 'BAZ': True } in superset_config.py
403403
# will result in combined feature flags of { 'FOO': True, 'BAR': True, 'BAZ': True }
404404
DEFAULT_FEATURE_FLAGS: dict[str, bool] = {
405-
# Experimental feature introducing a client (browser) cache
406-
"CLIENT_CACHE": False, # deprecated
407405
# When using a recent version of Druid that supports JOINs turn this on
408406
"DRUID_JOINS": False,
409407
"DYNAMIC_PLUGINS": False,

0 commit comments

Comments
 (0)