Whole file
fastavro/fastavro
The author described this change as “fix namespace handling”. It counts as a record because the check below fails on the code as it stood at 215105c91 and passes on 2bc6f7778, with nothing else changed between the two runs.
Projectfastavro/fastavro
Fix saved2023-05-04
Sharing licenceMIT · LICENSE
Change size+5 −5
What the code was meant to do, written into the code itself as a save note
fix namespace handling
The change
| 103 | 103 | ) | |
| 104 | 104 | ||
| 105 | 105 | namespace = schema.get("namespace", parent_ns) | |
| 106 | - | if not namespace: | |
| 107 | - | return namespace, name | |
| 108 | - | elif "." in name: | |
| 109 | - | return "", name | |
| 110 | - | else: | |
| 106 | + | if "." in name: | |
| 107 | + | return name.rsplit(".", 1)[0], name | |
| 108 | + | elif namespace: | |
| 111 | 109 | return namespace, f"{namespace}.{name}" | |
| 110 | + | else: | |
| 111 | + | return "", name | |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | 114 | def expand_schema(schema: Schema) -> Schema: |
The check that tells the two apart
fail→pass·tests/test_schema.py::test_namespace_respected
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 it215105c9118f6d80f54f3fe25e470bea4c534b8e
Broken version dated2023-04-19
Modulefastavro._schema_py
Units changedschema_name
Fingerprint8cca221e1bbe8834
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)
- 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