Whole file

fastavro/fastavro

The author described this change as Fix aliases in schema resolution (#751). It counts as a record because the check below fails on the code as it stood at 7153d47a0 and passes on 6606ccc8a, with nothing else changed between the two runs.

Fix saved2024-02-13
Sharing licenceMIT · LICENSE
Change size+5 1

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

Fix aliases in schema resolution (#751)

The change

114114 w_unqual_name = w_schema["name"].split(".")[-1]
115115 r_unqual_name = r_schema["name"].split(".")[-1]
116116 r_aliases = r_schema.get("aliases", [])
117- if w_unqual_name == r_unqual_name or w_schema["name"] in r_aliases:
117+ if (
118+ w_unqual_name == r_unqual_name
119+ or w_schema["name"] in r_aliases
120+ or w_unqual_name in r_aliases
121+ ):
118122 return r_schema
119123 elif w_type not in AVRO_TYPES and r_type in NAMED_TYPES:
120124 if match_types(w_type, r_schema["name"], named_schemas):

The check that tells the two apart

failpass·tests/test_aliases.py::test_alias_in_same_namespace

Check file tests/test_aliases.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 it7153d47a074856947305d8ef0819f3f4235cfe40
Broken version dated2024-02-11
Modulefastavro._read_py
Units changedmatch_schemas
Fingerprint60a9f9b0391d06cd
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