You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2025/01/10 19:57:07 UTC
[PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
rusackas opened a new pull request, #31794:
URL: https://github.com/apache/superset/pull/31794
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Approved 5.0 change. The feature is now ready for prime time!
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1913897842
##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########
@@ -475,8 +472,7 @@ const DashboardBuilder = () => {
ELEMENT_ON_SCREEN_OPTIONS,
);
- const showFilterBar =
- (crossFiltersEnabled || nativeFiltersEnabled) && !editMode;
Review Comment:
Not sure, actually, but it's part of an OR statement, so with crossFiltersEnabled always being true, it doesn't actually matter, and will just be the same as `!editMode`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1931597330
##########
superset-frontend/src/dashboard/actions/dashboardState.js:
##########
@@ -437,10 +435,8 @@ export function saveDashboardRequest(data, id, saveType) {
) {
let chartConfiguration = {};
let globalChartConfiguration = {};
- if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
- ({ chartConfiguration, globalChartConfiguration } =
- handleChartConfiguration());
- }
+ ({ chartConfiguration, globalChartConfiguration } =
Review Comment:
We can remove the `let` declarations above and use const here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1913898279
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/FilterBarSettings.test.tsx:
##########
@@ -104,44 +104,14 @@ test('Dropdown trigger does not render without dashboard edit permissions', asyn
expect(screen.queryByRole('img', { name: 'gear' })).not.toBeInTheDocument();
});
-test('Dropdown trigger renders with FF DASHBOARD_CROSS_FILTERS on', async () => {
Review Comment:
Did you want to update this test as just "Dropdown trigger renders"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1931602618
##########
superset-frontend/src/dashboard/components/nativeFilters/selectors.ts:
##########
@@ -379,16 +375,14 @@ export const selectNativeIndicatorsForChart = (
});
let crossFilterIndicators: any = [];
- if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
- crossFilterIndicators = selectChartCrossFilters(
- dataMask,
- chartId,
- chartLayoutItems,
- chartConfiguration,
- appliedColumns,
- rejectedColumns,
- );
- }
Review Comment:
Same as above, letβs just use const here π
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1914675646
##########
superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts:
##########
@@ -45,6 +45,12 @@ describe('nativeFilterGate', () => {
});
it('should return false for native filter chart with cross filter support', () => {
+ isFeatureEnabledMock.mockImplementation(feature => {
+ if (feature === FeatureFlag.DASHBOARD_CROSS_FILTERS) return false;
Review Comment:
I believe `FeatureFlag.DASHBOARD_CROSS_FILTERS` will not exist anymore given that we are removing the feature flag. We need to remove all references of it.
##########
UPDATING.md:
##########
@@ -23,6 +23,7 @@ This file documents any backwards-incompatible changes in Superset and
assists people when migrating to a new version.
## Next
+- [31794](https://github.com/apache/superset/pull/31794) Removed the previously deprecated `DASHBOARD_CROSS_FILTERS` feature flag
Review Comment:
```suggestion
- [31794](https://github.com/apache/superset/pull/31794) Removed the previously deprecated `DASHBOARD_CROSS_FILTERS` feature flag.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1913896329
##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########
@@ -475,8 +472,7 @@ const DashboardBuilder = () => {
ELEMENT_ON_SCREEN_OPTIONS,
);
- const showFilterBar =
- (crossFiltersEnabled || nativeFiltersEnabled) && !editMode;
Review Comment:
was `nativeFiltersEnabled` already cleaned up?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1932261354
##########
superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts:
##########
@@ -16,75 +16,28 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { Behavior, FeatureFlag } from '@superset-ui/core';
-import * as uiCore from '@superset-ui/core';
+import { Behavior } from '@superset-ui/core';
import { DashboardLayout } from 'src/dashboard/types';
import { CHART_TYPE } from 'src/dashboard/util/componentTypes';
import { nativeFilterGate, findTabsWithChartsInScope } from './utils';
-let isFeatureEnabledMock: jest.MockInstance<boolean, [feature: FeatureFlag]>;
-
describe('nativeFilterGate', () => {
- describe('with all feature flags disabled', () => {
Review Comment:
I removed those tests as they didn't make sense now since we got rid of the featuer flags
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje merged PR #31794:
URL: https://github.com/apache/superset/pull/31794
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1913898923
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/FilterBarSettings.test.tsx:
##########
@@ -104,44 +104,14 @@ test('Dropdown trigger does not render without dashboard edit permissions', asyn
expect(screen.queryByRole('img', { name: 'gear' })).not.toBeInTheDocument();
});
-test('Dropdown trigger renders with FF DASHBOARD_CROSS_FILTERS on', async () => {
Review Comment:
The dropdown trigger is clicked in other tests so I wasn't worried about keeping it as a separate one. Those other tests would fail if it didn't render.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1915069697
##########
superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts:
##########
@@ -45,6 +45,12 @@ describe('nativeFilterGate', () => {
});
it('should return false for native filter chart with cross filter support', () => {
+ isFeatureEnabledMock.mockImplementation(feature => {
+ if (feature === FeatureFlag.DASHBOARD_CROSS_FILTERS) return false;
Review Comment:
Yeah, I did, and then I tried Cursor to get tests to pass, and it brought it right back! Ugh.
##########
superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts:
##########
@@ -45,6 +45,12 @@ describe('nativeFilterGate', () => {
});
it('should return false for native filter chart with cross filter support', () => {
+ isFeatureEnabledMock.mockImplementation(feature => {
+ if (feature === FeatureFlag.DASHBOARD_CROSS_FILTERS) return false;
Review Comment:
Yeah, I did, and then I tried using Cursor to get tests to pass, and it brought it right back! Ugh.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1932017333
##########
superset-frontend/src/components/Chart/ChartRenderer.jsx:
##########
@@ -90,10 +88,7 @@ class ChartRenderer extends Component {
)?.suppressContextMenu;
this.state = {
showContextMenu:
- props.source === ChartSource.Dashboard &&
- !suppressContextMenu &&
- (isFeatureEnabled(FeatureFlag.DrillToDetail) ||
Review Comment:
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #31794:
URL: https://github.com/apache/superset/pull/31794#issuecomment-2619139980
@rusackas I think the tests should pass now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1931594904
##########
superset-frontend/src/components/Chart/ChartRenderer.jsx:
##########
@@ -90,10 +88,7 @@ class ChartRenderer extends Component {
)?.suppressContextMenu;
this.state = {
showContextMenu:
- props.source === ChartSource.Dashboard &&
- !suppressContextMenu &&
- (isFeatureEnabled(FeatureFlag.DrillToDetail) ||
Review Comment:
I think we should keep the check for drill to detail here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1911183678
##########
superset-frontend/src/dashboard/util/crossFilters.ts:
##########
@@ -38,8 +36,7 @@ import { CHART_TYPE } from './componentTypes';
export const isCrossFiltersEnabled = (
metadataCrossFiltersEnabled: boolean | undefined,
): boolean =>
- isFeatureEnabled(FeatureFlag.DashboardCrossFilters) &&
- (metadataCrossFiltersEnabled === undefined || metadataCrossFiltersEnabled);
+ metadataCrossFiltersEnabled === undefined || metadataCrossFiltersEnabled;
Review Comment:
### Cross Filters Default Behavior Changed <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The function isCrossFiltersEnabled now always returns true when metadataCrossFiltersEnabled is undefined, which might enable cross filters in scenarios where they should be disabled.
###### Why this matters
Prior to this change, cross filters required both the feature flag AND the metadata check. Now it only relies on metadata, which could unexpectedly enable cross filters in dashboards that previously had them disabled.
###### Suggested change β *Feature Preview*
To maintain the previous default behavior, consider modifying the function to default to false when the metadata is undefined:
```typescript
export const isCrossFiltersEnabled = (
metadataCrossFiltersEnabled: boolean | undefined,
): boolean =>
metadataCrossFiltersEnabled === true;
```
</details>
###### Chat with Korbit by mentioning @korbit-ai, and give a π or π to help Korbit improve your reviews.
<!--- korbi internal id:cdb4d0ea-4fa2-4d36-99e5-95cf20ad7d0c -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #31794:
URL: https://github.com/apache/superset/pull/31794#discussion_r1913897842
##########
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx:
##########
@@ -475,8 +472,7 @@ const DashboardBuilder = () => {
ELEMENT_ON_SCREEN_OPTIONS,
);
- const showFilterBar =
- (crossFiltersEnabled || nativeFiltersEnabled) && !editMode;
Review Comment:
Not sure, actually, but it's part of an OR statement, so with crossFiltersEnabled always being true, it doesn't actually matter, so the whole parenthetical will be true, and then `showFilterBar` can be replaced by `!editMode`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org