john-bodley opened a new pull request, #23314: URL: https://github.com/apache/superset/pull/23314
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY This PR partially addresses recommendation #⁠1 in https://github.com/apache/superset/issues/14383. I noticed that the the native filter modal was calling the RESTful GET `/api/v1/dataset/{pk}` endpoint twice (without parameters): once when it needed the columns with a dataset and once for when it required the metrics et al. Though these calls were in theory where cached (using a local cache) via the `cachedSupersetGet` method, the local cache was defined multiple times (on a per file basis) rather than once for the entire modal. The TL;DR is local caches are great, so long as they're not too local. The fix is merely to define the native filter modal caching mechanism once so it can be shared by the various components. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF #### BEFORE When opening the modal there are two calls to the GET `/api/v1/dataset/20` endpoint. <img width="1321" alt="Screenshot 2023-03-09 at 6 48 34 AM" src="https://user-images.githubusercontent.com/4567245/223800530-11cb2194-b47c-4a1b-8313-07d43a43d07e.png"> #### AFTER When opening the modal there is one call to the GET `/api/v1/dataset/20` endpoint. <img width="1355" alt="Screenshot 2023-03-09 at 7 22 53 AM" src="https://user-images.githubusercontent.com/4567245/223800393-9f8a57bc-6584-4cb3-9f0f-b80583ae2f22.png"> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> ### 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org