kgabryje opened a new pull request #15120: URL: https://github.com/apache/superset/pull/15120
### SUMMARY This PR introduces an optimization in running queries for native filters data. Currently when user opens a dashboard, we run queries for every native filter, regardless if it's hidden in the "Filters out of scope" panel or not. This PR defers running filter queries until the filter is visible. There are 2 scenarios: 1. Initially we run queries only for the filters in scope. When user uncollapses "Filters out of scope" panel, we run queries for all the filters that haven't been loaded yet. 2. Initially we run queries only for the filters in scope. When user switches a tab, causing more filters to be in scope, we run queries only for the filters which have just become visible. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Please notice how many `data` requests there are in Network panel Before: https://user-images.githubusercontent.com/15073128/121710250-b64ac700-cad9-11eb-9ed0-df768225989f.mov After: Scenario 1: https://user-images.githubusercontent.com/15073128/121710332-ccf11e00-cad9-11eb-80f2-7bf6f4bb0dbe.mov Scenario 2: https://user-images.githubusercontent.com/15073128/121710470-f01bcd80-cad9-11eb-8b8f-1104b18fc611.mov ### TESTING INSTRUCTIONS 0. Set `DASHBOARD_NATIVE_FILTERS` feature flag to True 1. Create a dashboard with tabs 2. Add a few native filters, so that some are initially in scope and some out of scope. 3. Verify that we run queries only for filters in scope, until you open "Filters out of scope" panel or navigate to a tab that has charts in scope of other filters. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] 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 CC: @junlincc @villebro -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
