dosubot[bot] commented on issue #31975: URL: https://github.com/apache/superset/issues/31975#issuecomment-2610355316
<!-- Answer --> I found a similar unsolved discussion that might be relevant to your issue: [4.1.1 migration troubleshooting with url_param() current_username() keywords in sql dataset](https://github.com/apache/superset/discussions/31950), which was last updated on January 22, 2025 <sup>[[1]](https://github.com/apache/superset/discussions/31950)</sup>. Regarding your issue, the `GLOBAL_ASYNC_QUERIES` flag in Superset 4.1.1 affects cache key retrieval by enabling asynchronous query execution. When this flag is enabled, Superset first attempts to retrieve the chart query results from the cache. If the results are not found, a background job is initiated to run the chart query <sup>[[2]](https://github.com/apache/superset/blob/master/superset/views/core.py)</sup>. The `current_username()` and `url_param()` functions interact with the caching system by including their values in the cache key calculation. This behavior can be controlled by setting `add_to_cache_keys=False` in your Jinja code, which might help in resolving the cache retrieval issues you're facing <sup>[[3]](https://github.com/apache/superset/blob/master/docs/docs/configuration/sql-templating.mdx)</sup><sup>[[4]](https://github.com/apache/superset/blob/master/superset/jinja_context.py)</sup>. It might be beneficial to review the changes made in the GitHub pull request #29840, as it addresses issues related to cache key retrieval, particularly when using Jinja functions like `current_username()`, `cache_key_wrapper()`, and `url_param()`. This could be relevant to the problems you're experiencing with cache retrieval when the `GLOBAL_ASYNC_QUERIES` flag is set to True. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/5ecddb47-5286-4b4c-af02-2e7c70ee0c6c?feedback_type=other)</sup> -- 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]
