ktmud commented on code in PR #20632:
URL: https://github.com/apache/superset/pull/20632#discussion_r915339557


##########
superset/dashboards/permalink/commands/create.py:
##########
@@ -40,21 +53,28 @@ def __init__(
         self.dashboard_id = dashboard_id
         self.state = state
 
+    @property
+    def value(self) -> DashboardPermalinkValue:
+        return {
+            "dashboardId": self.dashboard_id,
+            "state": self.state,
+        }
+
+    @property
+    def signature(self) -> Tuple[Optional[int], DashboardPermalinkValue]:
+        return (get_owner_id(self.actor), self.value)
+
     def run(self) -> str:
         self.validate()
         try:
             DashboardDAO.get_by_id_or_slug(self.dashboard_id)
-            value = {
-                "dashboardId": self.dashboard_id,
-                "state": self.state,
-            }
-            key = CreateKeyValueCommand(
+            key = UpsertKeyValueCommand(
+                key=get_deterministic_uuid(self.salt, self.signature),

Review Comment:
   Theoretically the uuid3 would never collide with another uuid3, but there is 
an extremely small chance of colliding with a uuid4. Once we change the Explore 
permalink to this deterministic id, too, this should not be a concern.



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

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


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

Reply via email to