rdblue commented on code in PR #5011:
URL: https://github.com/apache/iceberg/pull/5011#discussion_r905383690
##########
python/src/iceberg/types.py:
##########
@@ -59,134 +62,176 @@ class IcebergType:
'IcebergType()'
"""
- @property
- def string_type(self) -> str:
- return self.__repr__()
-
- def __str__(self) -> str:
- return self.string_type
+ @classmethod
+ def __get_validators__(cls):
+ # one or more validators may be yielded which will be called in the
+ # order to validate the input, each validator will receive as an input
+ # the value returned from the previous validator
+ yield cls.validate
+
+ @classmethod
+ def validate(cls, v):
Review Comment:
Okay, I see the calls to `parse`. That brings us back to my original
question, which is why are we doing parsing in a validate method? Shouldn't
this validate the input rather than returning the deserialized value?
I would expect this to do something like the schema validator, which would
change `"fixed[12]"` into `{"__root__": "fixed", "length": 12} or something.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]