noidname01 commented on code in PR #4046:
URL: https://github.com/apache/gravitino/pull/4046#discussion_r1663592094
##########
clients/client-python/gravitino/name_identifier.py:
##########
@@ -26,7 +28,13 @@ class NameIdentifier(DataClassJsonMixin):
_DOT: ClassVar[str] = "."
_name: str = field(metadata=config(field_name="name"))
- _namespace: Namespace = field(metadata=config(field_name="namespace"))
+ _namespace: Namespace = field(
+ metadata=config(
+ field_name="namespace",
+ encoder=Namespace.to_json,
Review Comment:
Because when deserializing from json, the namespace itself will be a `list`,
not a `Namespace`, so the code here is to add encode and decode logic when
`dataclass_json` try to handle the DTO. Otherwise, the `namespace` here will be
a plain `list`.
--
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]