tsungchih commented on PR #6903: URL: https://github.com/apache/gravitino/pull/6903#issuecomment-2824839284
> @tsungchih Could you explain why you need to implement a `json_serdes` util ? See what `MetalakeDTO` did, simply inherit from`DataClassJsonMixin` in `dataclasses_json` library. > > ``` > from dataclasses_json import DataClassJsonMixin, config > > ... > @dataclass > class MetalakeDTO(Metalake, DataClassJsonMixin): > ... > ``` > > Reference: > > * [Docs from dataclasses-json](https://lidatong.github.io/dataclasses-json/) @unknowntpo Thanks for your comments. That is because all of the current Gravitino `Type` defined in `gravitino.api.types.types.Types`, such as `NullType`, `BooleanType`, etc., do not support `dataclass-json`. Namely they do not inherit from `DataClassJsonMixin` in `dataclasses_json` library. IMHO, here comes with two solutions to serialize/deserialize `Type` listed as follows. 1. make all of the `Type`s support for `dataclass-json`; (this will be a significant change to the interface and I'm not sure if it is acceptable) 2. remain `Type`s unchanged and define serializer/deserializer for them (this is the current PR) Regards -- 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]
