Whole file
fastavro/fastavro
The author described this change as “fix issue where _inject_schema was confused about a previously injected schema”. It counts as a record because the check below fails on the code as it stood at 3a15d0f13 and passes on 67126e5f3, with nothing else changed between the two runs.
Projectfastavro/fastavro
Fix saved2021-01-17
Sharing licenceMIT · LICENSE
Change size+3 −4
What the code was meant to do, written into the code itself as a save note
fix issue where _inject_schema was confused about a previously injected schema
The change
| 510 | 510 | if outer_schema == inner_schema["name"]: | |
| 511 | 511 | return inner_schema, True | |
| 512 | 512 | else: | |
| 513 | - | raise Exception( | |
| 514 | - | "Internal error; " | |
| 515 | - | + "You should raise an issue in the fastavro github repository" | |
| 516 | - | ) | |
| 513 | + | # Hit a named schema that has already been loaded previously. Return | |
| 514 | + | # the outer_schema so we keep looking | |
| 515 | + | return outer_schema, is_injected | |
| 517 | 516 | else: | |
| 518 | 517 | # Remaining valid schemas must be dict types | |
| 519 | 518 | schema_type = outer_schema["type"] |
The check that tells the two apart
fail→pass·tests/test_schema.py::test_load_schema_bug
Check file tests/test_schema.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 it3a15d0f137357a626ac42cc22d05e5c5a05affe0
Broken version dated2021-01-15
Modulefastavro._schema_py
Units changed_inject_schema
Fingerprint4924fa9d507a9b43
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
- 2024-02-13Fix aliases in schema resolution (#751)
- 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