Abyss-lord commented on code in PR #10554:
URL: https://github.com/apache/gravitino/pull/10554#discussion_r3013035027
##########
clients/client-python/gravitino/client/gravitino_metalake.py:
##########
@@ -623,8 +641,31 @@ def alter_tag(self, tag_name, *changes) -> Tag:
NoSuchTagException: If the tag does not exist.
NoSuchMetalakeException: If the metalake does not exist.
"""
- # TODO implement alter_tag
- raise NotImplementedError()
+ Precondition.check_argument(
+ StringUtils.is_not_blank(tag_name),
+ "tag name must not be null or empty",
+ )
+ updates = [DTOConverters.to_tag_update_request(change) for change in
changes]
+ update_req = TagUpdatesRequest(updates)
+ update_req.validate()
+
+ url = self.API_METALAKES_TAG_PATH.format(
+ encode_string(self.name()), encode_string(tag_name)
+ )
+ response = self.rest_client.post(
+ url,
+ json=update_req,
+ error_handler=TAG_ERROR_HANDLER,
+ )
+ tag_resp: TagResponse = TagResponse.from_json(response.body,
infer_missing=True)
+ tag_resp.validate()
+
+ tag_resp.validate()
Review Comment:
fix
--
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]