One function
validate_string in fastavro/fastavro
The author described this change as “Union UUID fix (#310)”. It counts as a record because the check below fails on the code as it stood at fc9661a2d and passes on 9ae09affe, with nothing else changed between the two runs.
Projectfastavro/fastavro
Fix saved2019-01-22
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a docstring
Check that the data value is string type, uses six for Python version compatibility. Parameters ---------- datum: Any Data being validated kwargs: Any Unused kwargs
The change
| 1 | 1 | def validate_string(datum, **kwargs): | |
| 2 | 2 | """ | |
| 3 | - | Check that the data value is string type, uses | |
| 3 | + | Check that the data value is string or UUID type, uses | |
| 4 | 4 | six for Python version compatibility. | |
| 5 | 5 | ||
| 6 | 6 | Parameters | |
| ⋯ | |||
| 10 | 10 | kwargs: Any | |
| 11 | 11 | Unused kwargs | |
| 12 | 12 | """ | |
| 13 | - | return is_str(datum) | |
| 13 | + | return is_str(datum) or isinstance(datum, UUID) | |
The check that tells the two apart
fail→pass·tests/test_complex.py::test_complex_schema
Check file tests/test_complex.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 itfc9661a2d078f279069cd0a43a3c847d4f212025
Broken version dated2019-01-21
Modulefastavro._validation_py
Units changedvalidate_string
Fingerprint3fdc94d4cf99e5f4
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