fix: Forced refresh async queries are executed synchronously
SUMMARY
Deleted a cache check for async queries when cache is forced. Attached screenshots (please, see below) to demonstrate logs that show expected behaviour after the change.
Fixes https://github.com/apache/superset/issues/24889
Context:
When chart data is forced to refresh in chart view, query is executed in synchronous manner, even when GLOBAL_ASYNC_QUERIES=True.
Expected results Superset should:
- Request chart data (POST /api/v1/chart/data?form_data=<fomr_data>)
- Poll for results (GET /api/v1/async_event/?last_id=<last_id>)
- Get results (GET /api/v1/chart/data/<cache_key>)
Actual results: Superset sends POST /api/v1/chart/data and waits for that request to return results.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
- [x] 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
@zhaoyongjie would you mind reviewing this? It seems, per here, that you may have authored this logic.
@zhaoyongjie would you mind reviewing this? It seems, per here, that you may have authored this logic.
Let me catch up the change....thanks for the mention.
Thanks for the review @zhaoyongjie - would love to get this merged so we can close https://github.com/apache/superset/issues/24889, which has been open for a long time.
I wonder if @craig-rueda or @villebro know this area enough to help see this through...
Till we figure out a better solve
I've moved the cache lookup behind an if statement checking the value of force