Open ganczarek opened 1 year ago
When chart data is forced to refresh in chart view, query is executed in synchronous manner, even when GLOBAL_ASYNC_QUERIES=True.
GLOBAL_ASYNC_QUERIES=True
Superset should:
POST /api/v1/chart/data?form_data=<fomr_data>
GET /api/v1/async_event/?last_id=<last_id>
GET /api/v1/chart/data/<cache_key>
Superset sends POST /api/v1/chart/data and waits for that request to return results.
POST /api/v1/chart/data
2.1.0
3.8.13
N/A
Make sure to follow these steps before submitting your issue - thank you!
The issue seems to be in QueryCacheManager. When query is forced it returns query_cache object early and ignores forced_cached flag check. In result, it ends getting query results immediately rather than throwing exception and getting results asynchronously.
QueryCacheManager
I also suspect that when query is forced, there's not need to check cache at all.
Seems like the PR is getting reasonably close... hope we can get it across the finish line!
Pinging @villebro since he's been looking at stuff in this area.
When chart data is forced to refresh in chart view, query is executed in synchronous manner, even when
GLOBAL_ASYNC_QUERIES=True
.How to reproduce the bug
Expected results
Superset should:
POST /api/v1/chart/data?form_data=<fomr_data>
)GET /api/v1/async_event/?last_id=<last_id>
)GET /api/v1/chart/data/<cache_key>
)Actual results
Superset sends
POST /api/v1/chart/data
and waits for that request to return results.Environment
2.1.0
3.8.13
N/A
GLOBAL_ASYNC_QUERIES=True
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
The issue seems to be in
QueryCacheManager
. When query is forced it returns query_cache object early and ignores forced_cached flag check. In result, it ends getting query results immediately rather than throwing exception and getting results asynchronously.I also suspect that when query is forced, there's not need to check cache at all.