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: Drill by open in Explore #23575

Merged
merged 3 commits into from
Apr 5, 2023
Merged

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Apr 4, 2023

SUMMARY

This PR enables opening Drill By chart in Explore. The feature is similar to "Edit chart" in Dashboard, except in this case we treat the drill by result as a completely new chart - which means that we don't preserve the original chart's id or name. Additionally, the filters inherited from dashboard (native filters, cross filters) are not treated as "extra" filters, which means they will get saved with the chart (as opposed to editing an existing chart from the dashboard).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2023-04-04.at.14.39.10.mov

TESTING INSTRUCTIONS

  1. Enable DRILL_BY ff
  2. Right click on a series -> drill by -> column
  3. In drill by modal, click (or right click to open in new tab) "Edit chart"
  4. You should see exactly the same chart in Explore as it was in the drill by modal. Compared to original chart, the adhoc filters have additional filter equal to clicked series appended, and groupby is replaced by clicked column.
  5. If there were any native filters or cross filters in the dashboard, they are added as adhoc filters in Explore, but NOT as "extra" filters - they don't have the warning icon and they will get saved with the chart.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@lilykuang lilykuang left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #23575 (27fdf33) into master (d966db6) will increase coverage by 0.01%.
The diff coverage is 86.11%.

❗ Current head 27fdf33 differs from pull request most recent head ebb51c9. Consider uploading reports for the commit ebb51c9 to get more accurate results

@@            Coverage Diff             @@
##           master   #23575      +/-   ##
==========================================
+ Coverage   67.71%   67.72%   +0.01%     
==========================================
  Files        1916     1916              
  Lines       74020    74029       +9     
  Branches     8041     8040       -1     
==========================================
+ Hits        50122    50136      +14     
+ Misses      21848    21845       -3     
+ Partials     2050     2048       -2     
Flag Coverage Δ
javascript 53.96% <84.37%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...ackages/superset-ui-core/src/query/types/Filter.ts 100.00% <ø> (ø)
...tend/src/components/Chart/DrillBy/DrillByChart.tsx 100.00% <ø> (+7.14%) ⬆️
.../nativeFilters/FilterBar/CrossFilters/selectors.ts 9.09% <0.00%> (-0.91%) ⬇️
...rc/dashboard/components/nativeFilters/selectors.ts 58.26% <ø> (+0.90%) ⬆️
superset-frontend/src/views/menu.tsx 0.00% <ø> (ø)
...tend/src/components/Chart/DrillBy/DrillByModal.tsx 86.66% <85.71%> (-5.00%) ⬇️
...nd/src/dashboard/components/FiltersBadge/index.tsx 85.71% <100.00%> (+1.09%) ⬆️
...re/controlUtils/getFormDataWithDashboardContext.ts 80.59% <100.00%> (+1.56%) ⬆️
superset/models/dashboard.py 78.16% <100.00%> (+0.29%) ⬆️
superset/models/slice.py 87.20% <100.00%> (+0.41%) ⬆️
... and 1 more

... and 2 files with indirect coverage changes

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

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.

Very exciting stuff! 😻 LGTM with a very optional typing improvement idea (if it feels like over abstraction it probably is, so feel free to ignore). Also, not something that needs to be addressed in this PR, but... I really wanted to see if I was able to drill further down into the chart 😆, and I was slightly 😿 when the context menu didn't show up:
image

Also, it would be nice if the drilling dimensions were somehow displayed in the drill down modal (I assume this is something that's planned for a future PR).

@kgabryje
Copy link
Member Author

kgabryje commented Apr 5, 2023

Very exciting stuff! 😻 LGTM with a very optional typing improvement idea (if it feels like over abstraction it probably is, so feel free to ignore). Also, not something that needs to be addressed in this PR, but... I really wanted to see if I was able to drill further down into the chart 😆, and I was slightly 😿 when the context menu didn't show up: image

Also, it would be nice if the drilling dimensions were somehow displayed in the drill down modal (I assume this is something that's planned for a future PR).

Both coming soon! 🙂

@kgabryje kgabryje merged commit 117360c into apache:master Apr 5, 2023
@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/L 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants