Fokko commented on code in PR #6525: URL: https://github.com/apache/iceberg/pull/6525#discussion_r1069592946
########## python/pyiceberg/avro/reader.py: ########## @@ -238,41 +249,50 @@ def skip(self, decoder: BinaryDecoder) -> None: return self.option.skip(decoder) -class StructProtocolReader(Reader): - create_struct: Callable[[], StructProtocol] - fields: Tuple[Tuple[Optional[int], Reader], ...] +class StructReader(Reader): + field_readers: Tuple[Tuple[Optional[int], Reader], ...] + create_struct: Type[StructProtocol] + struct: Optional[StructType] - def __init__(self, fields: Tuple[Tuple[Optional[int], Reader], ...], create_struct: Callable[[], StructProtocol]): - self.create_struct = create_struct - self.fields = fields - - def create_or_reuse(self, reuse: Optional[StructProtocol]) -> StructProtocol: - if reuse: - return reuse - else: - return self.create_struct() + def __init__( + self, + field_readers: Tuple[Tuple[Optional[int], Reader], ...], + create_struct: Optional[Type[StructProtocol]] = None, Review Comment: Inspecting gives different results amongst different Python version 😠It works fine locally on 3.10, but CI fails on 3.8. Looks like it doesn't look up the constructor of the class that it inherits from: ``` <class 'pyiceberg.avro.file.AvroFileHeader'> FullArgSpec(args=['cls'], varargs='args', varkw='kwds', defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}) ``` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org