Whole file

fastavro/fastavro

The author described this change as fix bug where records should match but they were not. It counts as a record because the checks below fail on the code as it stood at 2406ae348 and pass on 2b980fffb, with nothing else changed between the two runs.

Fix saved2022-05-21
Sharing licenceMIT · LICENSE
Change size+4 1

What the code was meant to do, written into the code itself as a save note

fix bug where records should match but they were not

The change

117117 "aliases", []
118118 ):
119119 return r_schema
120+ elif w_type not in AVRO_TYPES and r_type in NAMED_TYPES:
121+ if match_types(w_type, r_schema["name"]):
122+ return r_schema["name"]
120123 elif match_types(w_type, r_type):
121124 return r_schema
122125 raise SchemaResolutionError(error_msg)
576579
577580 record_type = extract_record_type(writer_schema)
578581
579- if reader_schema and record_type in AVRO_TYPES:
582+ if reader_schema:
580583 # If the schemas are the same, set the reader schema to None so that no
581584 # schema resolution is done for this call or future recursive calls
582585 if writer_schema == reader_schema:

The check that tells the two apart

failpass·tests/test_fastavro.py::test_name_changes_to_full_record
failpass·tests/test_fastavro.py::test_record_names_must_match

Check file tests/test_fastavro.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it2406ae34867634b4e4ce003b4bb508e557b06ce3
Broken version dated2022-05-21
Modulefastavro._read_py
Units changedmatch_schemas, read_data
Fingerprintf8d3fcccbf3465db
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in fastavro/fastavro