Fokko commented on code in PR #6342:
URL: https://github.com/apache/iceberg/pull/6342#discussion_r1045589430
##########
python/pyiceberg/schema.py:
##########
@@ -317,6 +331,97 @@ def primitive(self, primitive: PrimitiveType) -> T:
"""Visit a PrimitiveType"""
+class SchemaVisitorPerPrimitiveType(SchemaVisitor[T], ABC):
+ def primitive(self, primitive: PrimitiveType) -> T:
+ """Visit a PrimitiveType"""
+ if isinstance(primitive, FixedType):
Review Comment:
It should be roughly equivalent, the `isinstance` checks are not that
expensive. The main reason to go this route is that we can just OOP to call the
right method, and you can't override a `singledistpatchmethod` method, it will
still call the one on the base class.
--
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]