sunyuhan1998 commented on code in PR #11210:
URL: https://github.com/apache/gravitino/pull/11210#discussion_r3301340031
##########
clients/client-python/gravitino/client/dto_converters.py:
##########
@@ -325,3 +332,20 @@ def to_tag_update_request(
return
TagUpdateRequest.RemoveTagPropertyRequest(change.removed_property)
raise IllegalArgumentException(f"Unknown change type: {type(change)}")
+
+ @staticmethod
+ def to_privilege_dto(privilege: Privilege) -> PrivilegeDTO:
+ return PrivilegeDTO(privilege.name(), privilege.condition())
+
+ @staticmethod
+ def from_privilege_dto(dto: PrivilegeDTO) -> Privilege:
+ return dto
+
+ @staticmethod
+ def to_securable_object_dto(obj: SecurableObject) -> SecurableObjectDTO:
+ privilege_dtos = [DTOConverters.to_privilege_dto(p) for p in
obj.privileges()]
+ return SecurableObjectDTO(obj.full_name(), obj.type(), privilege_dtos)
+
+ @staticmethod
+ def from_securable_object_dto(dto: SecurableObjectDTO) -> SecurableObject:
+ return SecurableObjects.parse(dto.full_name(), dto.type(),
dto.privileges())
Review Comment:
Since `from_securable_object_dto` itself has been removed (no callers in
this PR), this code path no longer exists here.
--
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]