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.

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

11 def validate_string(datum, **kwargs):
22 """
3- Check that the data value is string type, uses
3+ Check that the data value is string or UUID type, uses
44 six for Python version compatibility.
55
66 Parameters
1010 kwargs: Any
1111 Unused kwargs
1212 """
13- return is_str(datum)
13+ return is_str(datum) or isinstance(datum, UUID)

The check that tells the two apart

failpass·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