You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/09 12:51:16 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #18576: feat: Improve state key generation for dashboards and charts

michael-s-molina commented on a change in pull request #18576:
URL: https://github.com/apache/superset/pull/18576#discussion_r802627775



##########
File path: superset/dashboards/filter_state/commands/create.py
##########
@@ -23,13 +25,17 @@
 
 
 class CreateFilterStateCommand(CreateKeyValueCommand):
-    def create(self, cmd_params: CommandParameters) -> bool:
+    def create(self, cmd_params: CommandParameters) -> str:
         resource_id = cmd_params.resource_id
         actor = cmd_params.actor
-        key = cache_key(resource_id, cmd_params.key)
+        contextual_key = cache_key(actor.get_user_id(), resource_id)
+        key = cache_manager.filter_state_cache.get(contextual_key)
+        if not key:
+            key = token_urlsafe(48)

Review comment:
       Nice catch! Done.




-- 
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-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org