martin-g opened a new pull request, #1636:
URL: https://github.com/apache/avro/pull/1636

   Running `cargo test validate -- --nocapture` produces 
   
   ```
   running 4 tests
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Int(42) for 
schema: Boolean. Reason: Unsupported value-schema combination
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Null for 
schema: Double. Reason: Unsupported value-schema combination
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Boolean(true) 
for schema: Long. Reason: Unsupported value-schema combination
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Fixed(5, [0, 
0, 0, 0, 0]) for schema: Fixed { name: Name { name: "some_fixed", namespace: 
None }, aliases: None, doc: None, size: 4 }. Reason: The value's size (5) is 
different than the schema's size (4)
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Enum(1, 
"spades") for schema: Enum { name: Name { name: "some_enum", namespace: None }, 
aliases: None, doc: None, symbols: ["spades", "hearts", "diamonds", "clubs"] }. 
Reason: Symbol 'spades' is not at position '1'
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Record([]) 
for schema: Null. Reason: Unsupported value-schema combination
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Fixed(11, [0, 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) for schema: Duration. Reason: The value's size 
('11') must be exactly 12 to be a Duration
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Record([("b", 
String("foo")), ("a", Long(42))]) for schema: Record { name: Name { name: 
"some_record", namespace: None }, aliases: None, doc: None, fields: 
[RecordField { name: "a", doc: None, default: None, schema: Long, order: 
Ascending, position: 0 }, RecordField { name: "b", doc: None, default: None, 
schema: String, order: Ascending, position: 1 }], lookup: {} }. Reason: Value's 
name 'b' does not match the expected field's name 'a'
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Bytes([0, 0, 
0, 0, 0]) for schema: Fixed { name: Name { name: "some_fixed", namespace: None 
}, aliases: None, doc: None, size: 4 }. Reason: The bytes' length (5) is 
different than the schema's size (4)
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: 
String("lorem") for schema: Enum { name: Name { name: "some_enum", namespace: 
None }, aliases: None, doc: None, symbols: ["spades", "hearts", "diamonds", 
"clubs"] }. Reason: 'lorem' is not a member of the possible symbols
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: 
Boolean(false) for schema: Long. Reason: Unsupported value-schema combination
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: 
Record([("unknown_field_name", Null)]) for schema: Record { name: Name { name: 
"record_name", namespace: None }, aliases: None, doc: None, fields: 
[RecordField { name: "field_name", doc: None, default: None, schema: Int, 
order: Ignore, position: 0 }], lookup: {} }. Reason: Value's name 
'unknown_field_name' does not match the expected field's name 'field_name'
   test types::tests::validate_fixed ... ok
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Null for 
schema: Ref { name: Name { name: "missing", namespace: None } }. Reason: 
Unresolved schema reference: 'missing'. Parsed names: []
   test types::tests::validate ... ok
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Enum(0, 
"spades") for schema: Enum { name: Name { name: "some_other_enum", namespace: 
None }, aliases: None, doc: None, symbols: ["hearts", "diamonds", "clubs", 
"spades"] }. Reason: Symbol 'spades' is not at position '0'
   [2022-04-08T21:50:28Z ERROR apache_avro::types] Invalid value: Record([("a", 
Long(42)), ("b", String("foo")), ("c", Null)]) for schema: Record { name: Name 
{ name: "some_record", namespace: None }, aliases: None, doc: None, fields: 
[RecordField { name: "a", doc: None, default: None, schema: Long, order: 
Ascending, position: 0 }, RecordField { name: "b", doc: None, default: None, 
schema: String, order: Ascending, position: 1 }], lookup: {} }. Reason: The 
value's records length (3) is different than the schema's (2)
   test types::tests::validate_enum ... ok
   test types::tests::validate_record ... ok
   ```
   
   
   ### Jira
   
   - [X] My PR addresses the following [Avro 
Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them 
in the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-3483
   
   ### Tests
   
   - [X] My PR adds new unit tests
   
   ### Commits
   
   - [X] My commits all reference Jira issues in their subject lines. In 
addition, my commits follow the guidelines from "[How to write a good git 
commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [X] No need of new documentation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to