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

feat: Cross filters scoping #24020

Merged
merged 11 commits into from
May 16, 2023
Merged

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented May 11, 2023

SUMMARY

Add cross-filter scoping feature (previously removed in PR #23216).

In order to set cross filter scoping, user can open the scoping modal either from the configuration menu in upper left corner of the dashboard or from a options menu of any chart that's compatible with cross filters.

User can set a global scoping which will be a default scoping for every chart that supports cross filters. The global scoping can be overriden for each chart individually.

If a custom scoping for a chart is removed, the chart reverts to using the global scoping

Please take note that cross filter will NOT be applied to charts that have datasources incompatible with the emitter chart (target chart uses a different datasource which does not share a common column name with the emitter chart), even if they are in scope of the emitter chart!

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2023-05-12.at.14.56.25.mov

TESTING INSTRUCTIONS

  1. Enable DASHBOARD_CROSS_FILTERS feature flag
  2. Set global and custom scopings by entering the scoping modal from chart's options menu or from filter's config menu in the upper left corner
  3. Apply some cross filterings, verify that they match the scoping set for the source chart

ADDITIONAL INFORMATION

  • Has associated issue:

  • Required feature flags: DASHBOARD_CROSS_FILTERS

  • Changes UI

  • Includes DB Migration (follow approval process in SIP-59)

    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided Current: 0.21 s
      10+: 0.21 s
      100+: 0.14 s
      1000+: 0.22 s
  • Introduces new feature or API

  • Removes existing feature or API

CC @kasiazjc @yousoph

@kgabryje kgabryje requested a review from a team as a code owner May 11, 2023 13:08
@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Merging #24020 (9a9831a) into master (543040b) will increase coverage by 0.08%.
The diff coverage is 78.36%.

❗ Current head 9a9831a differs from pull request most recent head 41a4816. Consider uploading reports for the commit 41a4816 to get more accurate results

@@            Coverage Diff             @@
##           master   #24020      +/-   ##
==========================================
+ Coverage   68.20%   68.28%   +0.08%     
==========================================
  Files        1941     1951      +10     
  Lines       75287    75401     +114     
  Branches     8177     8183       +6     
==========================================
+ Hits        51347    51486     +139     
+ Misses      21845    21813      -32     
- Partials     2095     2102       +7     
Flag Coverage Δ
hive 53.16% <37.28%> (-0.02%) ⬇️
javascript 54.69% <79.55%> (+0.16%) ⬆️
mysql 78.91% <50.84%> (+0.01%) ⬆️
postgres 78.99% <50.84%> (+0.01%) ⬆️
presto 53.09% <44.06%> (+<0.01%) ⬆️
python 82.77% <71.18%> (+0.02%) ⬆️
sqlite 77.51% <50.84%> (+0.01%) ⬆️
unit 53.03% <45.76%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
...chart-controls/src/shared-controls/dndControls.tsx 58.33% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...n-chart-handlebars/src/plugin/controls/columns.tsx 15.78% <0.00%> (+0.78%) ⬆️
superset-frontend/src/SqlLab/actions/sqlLab.js 66.41% <ø> (-2.35%) ⬇️
...frontend/src/SqlLab/components/ResultSet/index.tsx 63.05% <ø> (+0.39%) ⬆️
superset-frontend/src/components/Modal/Modal.tsx 85.89% <ø> (ø)
...et-frontend/src/components/TableSelector/index.tsx 81.08% <0.00%> (ø)
superset-frontend/src/dashboard/actions/hydrate.js 2.04% <0.00%> (-0.05%) ⬇️
...odal/FiltersConfigForm/FilterScope/ScopingTree.tsx 90.90% <ø> (+18.18%) ⬆️
...rc/dashboard/components/nativeFilters/selectors.ts 58.26% <ø> (ø)
... and 70 more

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kgabryje kgabryje changed the title [WIP] feat: Cross filters scoping feat: Cross filters scoping May 12, 2023
@kgabryje
Copy link
Member Author

CC @TechAuditBI @itaipelles

@TechAuditBI
Copy link
Contributor

CC @TechAuditBI @itaipelles

Looks amazing!

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

First pass comments - I'll do some testing shortly.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM and tested to work as expected

@kgabryje kgabryje merged commit 4f3fbd3 into apache:master May 16, 2023
31 checks passed
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 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 size/XXL 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants