Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cross-filters): only apply filters if ff is set #13704

Merged
merged 2 commits into from
Mar 20, 2021

Conversation

villebro
Copy link
Member

SUMMARY

Currently charts that emit cross filtering events will apply to the dashboard even if the feature flag isn't set. This PR makes sure that the dataMask object doesn't contain any properties that haven't been explicitly enabled. Note that ownFilters is passed through irrespective of either the DASHBOARD_NATIVE_FILTERS or DASHBOARD_CROSS_FILTERS being set.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #13704 (6c2252a) into master (87d1afc) will decrease coverage by 4.27%.
The diff coverage is 90.00%.

❗ Current head 6c2252a differs from pull request most recent head 2321807. Consider uploading reports for the commit 2321807 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13704      +/-   ##
==========================================
- Coverage   77.38%   73.10%   -4.28%     
==========================================
  Files         928      615     -313     
  Lines       47002    21860   -25142     
  Branches     5806     5717      -89     
==========================================
- Hits        36371    15981   -20390     
+ Misses      10488     5736    -4752     
  Partials      143      143              
Flag Coverage Δ
cypress 56.49% <55.55%> (+0.01%) ⬆️
hive ?
javascript 63.12% <40.00%> (-0.02%) ⬇️
mysql ?
postgres ?
presto ?
python ?
sqlite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/dataMask/actions.ts 80.00% <85.71%> (+5.00%) ⬆️
...ConfigModal/FiltersConfigForm/FilterScope/state.ts 100.00% <100.00%> (ø)
superset/connectors/base/models.py
superset/models/helpers.py
superset/utils/urls.py
superset/tasks/async_queries.py
superset/sql_parse.py
superset/databases/schemas.py
superset/queries/dao.py
superset/charts/dao.py
... and 306 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87d1afc...2321807. Read the comment docs.

Comment on lines -54 to +56
if (cur?.type === CHART_TYPE && currentChartId !== cur?.meta?.chartId) {
return [...new Set([...acc, ...cur?.parents, cur.id])];
const { id, parents = [], type, meta } = cur;
if (type === CHART_TYPE && currentChartId !== meta?.chartId) {
return [...new Set([...acc, ...parents, id])];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This raised an error when the metadata was malformed (cur.parents was missing)

@villebro villebro merged commit 1a67f15 into apache:master Mar 20, 2021
@villebro villebro deleted the villebro/respect-filter-ff branch March 20, 2021 08:56
@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Mar 25, 2021
@junlincc junlincc added dashboard:cross-filters Related to the Dashboard cross filters and removed dashboard:native-filters Related to the native filters of the Dashboard labels Apr 27, 2021
allanco91 pushed a commit to allanco91/superset that referenced this pull request May 21, 2021
* fix(cross-filters): only apply filters if ff is set

* fix missing parent
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels dashboard:cross-filters Related to the Dashboard cross filters preset-io size/S 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants