roryqi commented on code in PR #12442:
URL: https://github.com/apache/gravitino/pull/12442#discussion_r3802978780
##########
clients/client-python/gravitino/client/generic_tag.py:
##########
@@ -113,38 +130,53 @@ def associated_objects(self) -> Tag.AssociatedObjects:
"""
return self
- def objects(self) -> list[MetadataObject]:
+ def objects(self, value: Optional[str] = None) -> list[MetadataObject]:
"""
Retrieve the list of objects that are associated with this tag.
+ Args:
+ value: The optional exact assignment value filter.
+
Returns:
list[MetadataObject]: The list of objects that are associated with
this tag.
"""
+ params = {}
+ if value is not None:
+ Precondition.check_argument(
+ value.strip() != "" and len(value) <= 256,
+ "value must not be empty or longer than 256 characters",
+ )
+ params["value"] = value
+
url = self.API_LIST_OBJECTS_ENDPOINT.format(
self._metalake,
encode_string(self.name()),
)
- response = self.get_response(url, TAG_ERROR_HANDLER)
+ response = self.get_response(url, TAG_ERROR_HANDLER, params)
Review Comment:
Done in 28470a1270. The unfiltered `objects()` path now calls the existing
two-argument `get_response(url, error_handler)` hook, while the value-filtered
path passes params. I also made `params` optional on the built-in hook and
added a regression test with a legacy two-argument override.
--
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]