Vitor-Avila opened a new pull request, #41214: URL: https://github.com/apache/superset/pull/41214
### SUMMARY When a chart's data/query is fetched with `filters_dashboard_id` (`GET /api/v1/chart/<id>/data/?filters_dashboard_id=<id>`), some dashboard filters were not properly applied. The current logic was relying on `chartsInScope`, which is recomputed on every load, so could be stale. This PR updates the logic to rely on `scope` (`rootPath` / `excluded`) instead. I believe the actual root-cause for stale/incorrect `chartsInScope` values might have been already fixed (for example with https://github.com/apache/superset/pull/38171) but this PR ensures dashboards in this state also work properly with this API endpoint. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF No UI changes. ### TESTING INSTRUCTIONS Test coverage updated. For manual testing: 1. Add a chart to a dashboard with default filter. 2. Make sure the filter is scoped to all charts, but intentionally remove the chart ID from `chartsInScope`. 3. Validate the filter still works properly via the UI. 4. Send a `GET` to `/api/v1/chart/<id>/data/?filters_dashboard_id=<id>` and confirm the query/data also includes the filter. ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
