Fokko commented on code in PR #3397:
URL: https://github.com/apache/avro/pull/3397#discussion_r2124761665


##########
lang/py/avro/io.py:
##########
@@ -633,9 +633,7 @@ def readers_schema(self, readers_schema: 
avro.schema.Schema) -> None:
     def read(self, decoder: "BinaryDecoder") -> object:
         if self.writers_schema is None:
             raise avro.errors.IONotReadyException("Cannot read without a 
writer's schema.")
-        if self.readers_schema is None:
-            self.readers_schema = self.writers_schema
-        return self.read_data(self.writers_schema, self.readers_schema, 
decoder)
+        return self.read_data(self.writers_schema, self.readers_schema if 
self.readers_schema is not None else self.writers_schema, decoder)

Review Comment:
   Let me refactor it 👍 



-- 
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]

Reply via email to