john-bodley commented on code in PR #20632:
URL: https://github.com/apache/superset/pull/20632#discussion_r915353795


##########
superset/key_value/utils.py:
##########
@@ -66,5 +67,11 @@ def get_uuid_namespace(seed: str) -> UUID:
     return UUID(md5_obj.hexdigest())
 
 
-def get_owner(user: User) -> Optional[int]:
-    return user.id if not user.is_anonymous else None
+def get_deterministic_uuid(namespace: str, payload: Any) -> UUID:
+    """Get a deterministic UUID (uuid3) from a salt and a payload."""
+    payload_str = json_dumps_w_dates(payload, sort_keys=True)
+    return uuid3(get_uuid_namespace(namespace), payload_str)
+
+
+def get_owner_id(user: Optional[User]) -> Optional[int]:

Review Comment:
   Note to self. This should be replaced with 
[get_user_id](https://github.com/apache/superset/blob/94b3d2f0f0e920e667bf2c2d9d3fbfd9ebcc3ffd/superset/utils/core.py#L1437-L1452)
 if/when https://github.com/apache/superset/pull/20499 is merged.



-- 
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