4.1.1 migration troubleshooting with url_param() current_username() keywords in sql dataset #31950
Replies: 1 comment
-
Hello, @ERGO1995! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together! To resolve the cache key retrieval issues you're experiencing in Superset 4.1.1 when using keywords like For example, the def current_username(self, add_to_cache_keys: bool = True) -> Optional[str]:
if username := get_username():
if add_to_cache_keys:
self.cache_key_wrapper(username)
return username
return None Similarly, ensure that the def url_param(
self,
param: str,
default: Optional[str] = None,
add_to_cache_keys: bool = True,
escape_result: bool = True,
) -> Optional[str]:
# ... (code to retrieve the URL parameter)
if add_to_cache_keys:
self.cache_key_wrapper(result)
return result Make sure these functions are used correctly in your SQL queries, and that the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Hello, for the past three days we have been trying to migrate our Superset version from 4.0.2 to 4.1.1, but we are encountering an issue seemingly related to cache key retrieval. We have a source dataset behind our charts that uses keywords such as current_username(), cache_key_wrapper(), or url_param(). This issue only occurs when the GLOBAL_ASYNC_QUERIES flag is set to True.
Everything was working fine in 4.0.2, but now we are facing errors like this:
As soon as I remove the above-mentioned keywords, the charts start working again. Has anyone faced a similar situation and could provide guidance on how to continue using these essential keywords in our context?
Beta Was this translation helpful? Give feedback.
All reactions