Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fastavro gives a default value for unions with nulls that don't have a default value #49
This is somewhat related to #48. Given this example schema:
the following should fail:
However, it does not, giving a default value of null to a field ('y') without a default value.
This stems from the use of .get(), which returns None if the key is not found.
This is just mixing up the lack of a value, with a value of null. Instead, the code should check for the field's existence in the datum, and return false if it doesn't exist.
This is related to #37, in that having write_record call validate() on itself would catch this. Although I imagine the overhead might raise some ire, so there are some options.
Some pull requests will be made in a bit.