This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 49fca82579 Fix mypy test (#3397)
49fca82579 is described below
commit 49fca82579ce865c4332108ad4557ec742afe8db
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
---
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