This is an automated email from the ASF dual-hosted git repository.

opwvhk pushed a commit to branch branch-1.12
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 5b42ea3bee738539c420ae97c3120201a36b14b9
Author: Fokko Driesprong <[email protected]>
AuthorDate: Tue Jun 3 21:45:17 2025 +0200

    Fix mypy test (#3397)
    
    * Fix mypy test
    
    And also run the Docker tests on pull-requests
    
    * Thanks Martin
    
    (cherry picked from commit 49fca82579ce865c4332108ad4557ec742afe8db)
---
 lang/py/avro/io.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lang/py/avro/io.py b/lang/py/avro/io.py
index c43002a027..4be3d8e057 100644
--- a/lang/py/avro/io.py
+++ b/lang/py/avro/io.py
@@ -633,9 +633,10 @@ class DatumReader:
     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)
+        reader_schema = self.readers_schema
+        if reader_schema is None:
+            reader_schema = self.writers_schema
+        return self.read_data(self.writers_schema, reader_schema, decoder)
 
     def read_data(self, writers_schema: avro.schema.Schema, readers_schema: 
avro.schema.Schema, decoder: "BinaryDecoder") -> object:
         # schema matching

Reply via email to