rdblue commented on code in PR #6525:
URL: https://github.com/apache/iceberg/pull/6525#discussion_r1066354508
##########
python/pyiceberg/avro/reader.py:
##########
@@ -238,26 +249,25 @@ def skip(self, decoder: BinaryDecoder) -> None:
return self.option.skip(decoder)
-class StructProtocolReader(Reader):
- create_struct: Callable[[], StructProtocol]
+class StructReader(Reader):
fields: Tuple[Tuple[Optional[int], Reader], ...]
+ create_struct: Type[StructProtocol]
- def __init__(self, fields: Tuple[Tuple[Optional[int], Reader], ...],
create_struct: Callable[[], StructProtocol]):
- self.create_struct = create_struct
+ def __init__(self, fields: Tuple[Tuple[Optional[int], Reader], ...],
create_struct: Type[StructProtocol] = Record):
self.fields = fields
-
- def create_or_reuse(self, reuse: Optional[StructProtocol]) ->
StructProtocol:
Review Comment:
Makes sense. I think we can do it later. We'd want to include the defaults
in the type system and replace the `NoneReader` with
`DefaultReader(defaultValue)`
--
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]