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.
Projectfastavro/fastavro
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
| 114 | 114 | w_unqual_name = w_schema["name"].split(".")[-1] | |
| 115 | 115 | r_unqual_name = r_schema["name"].split(".")[-1] | |
| 116 | 116 | 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 | + | ): | |
| 118 | 122 | return r_schema | |
| 119 | 123 | elif w_type not in AVRO_TYPES and r_type in NAMED_TYPES: | |
| 120 | 124 | if match_types(w_type, r_schema["name"], named_schemas): |
The check that tells the two apart
fail→pass·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
- 2023-05-04fix namespace handling
- 2022-09-09write_record
- 2022-07-29fix issue with decoding records within maps
- 2022-05-21fix bug where records should match but they were not
- 2021-12-22fix issue with json decoding of complex types within maps
- 2021-05-10parse_schema