One function
validate in fastavro/fastavro
The author described this change as “fix logicalType nullable date”. It counts as a record because the check below fails on the code as it stood at e752a9559 and passes on 0db133e4e, with nothing else changed between the two runs.
Projectfastavro/fastavro
Fix saved2017-10-31
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a docstring
Determine if a python datum is an instance of a schema.
The change
| 18 | 18 | return ( | |
| 19 | 19 | (isinstance(datum, (int, long,)) and | |
| 20 | 20 | INT_MIN_VALUE <= datum <= INT_MAX_VALUE) or | |
| 21 | - | isinstance(datum, (datetime.time, datetime.datetime)) | |
| 21 | + | isinstance(datum, (datetime.time, datetime.datetime, datetime.date)) | |
| 22 | 22 | ) | |
| 23 | 23 | ||
| 24 | 24 | if record_type == 'long': | |
| 25 | 25 | return ( | |
| 26 | 26 | (isinstance(datum, (int, long,)) and | |
| 27 | 27 | LONG_MIN_VALUE <= datum <= LONG_MAX_VALUE) or | |
| 28 | - | isinstance(datum, (datetime.time, datetime.datetime)) | |
| 28 | + | isinstance(datum, (datetime.time, datetime.datetime, datetime.date)) | |
| 29 | 29 | ) | |
| 30 | 30 | ||
| 31 | 31 | if record_type in ['float', 'double']: |
The check that tells the two apart
fail→pass·tests/test_logical_types.py::test_not_null_date
Check file tests/test_logical_types.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 ite752a9559368ea2d12d17f33263a2c80e8c9409f
Broken version dated2017-09-17
Modulefastavro.writer
Units changedvalidate
Fingerprintde3b107df8d80e69
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