Conversation
…ing into Value::Float/Double Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
martin-g
added a commit
that referenced
this pull request
Aug 7, 2024
…g numbers with Java and C# (#3073) * AVRO-4024: [Rust] Improve the error messages when parsing unknown String into Value::Float/Double Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> * AVRO-4024: [Rust] Accept only "Nan", "INF", "-INF", "Infinity" and "-Infinity" This is what the Java SDK (via Jackson library) supports (#3066). This is what the C# SDK also would support (#3070) Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> --------- Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> (cherry picked from commit dffc13a)
xxchan
reviewed
Aug 7, 2024
Comment on lines
+3146
to
+3156
| match value.resolve(&schema) { | ||
| Err(err @ Error::GetDouble(_)) => { | ||
| assert_eq!( | ||
| format!("{err:?}"), | ||
| r#"Double expected, got String("unknown")"# | ||
| ); | ||
| } | ||
| other => { | ||
| panic!("Expected Error::GetDouble, got {other:?}"); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Just FYI: there's a tool that can make testing a lot more happier https://github.com/rust-analyzer/expect-test
Basically it's just like
assert_eq!(format!("{:?}", value.resolve(&schema)), "balabala")We don't manually match, but just print out the result.
What's cooler is that expect_test can automatically update the actual result for you. (You can see the video demo in that repo)
opwvhk
pushed a commit
to opwvhk/avro
that referenced
this pull request
Sep 5, 2025
…g numbers with Java and C# (apache#3073) * AVRO-4024: [Rust] Improve the error messages when parsing unknown String into Value::Float/Double Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> * AVRO-4024: [Rust] Accept only "Nan", "INF", "-INF", "Infinity" and "-Infinity" This is what the Java SDK (via Jackson library) supports (apache#3066). This is what the C# SDK also would support (apache#3070) Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> --------- Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AVRO-4024
This PR is a follow up of #3051
What is the purpose of the change
Verifying this change
Documentation