AVRO-1463 [Perl] Quietly validate undefined values #2975
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
The code to validate data against a schema made some assumptions about the state of the data before validating, which resulted in some spurious warnings being raised when validating undefined values for some data types. This change, based on one submitted by John Karp back in 2014 for https://issues.apache.org/jira/browse/AVRO-1463, resolves this issue and expands the test suite to test the validation of undefined values for all primitive data types.
Verifying this change
This change extends
t/01_schema.t
to include a test for validating undefined values for all primitive types.Note that these tests do not fail when warnings are raised, but simply exercise the code that used to issue warnings we want to avoid. Making the code fail on warnings, particularly as a global condition, risks making the test suite brittle, since we don't control what may raise warnings in the future. This makes it more likely we'll spot them.
Documentation