Repository navigation
feat!:Make AvroSchemaComponent available without derive feature - #394
Merged
Merged
Conversation
Fixes #363 Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
14 of 25 tasks
Contributor
|
I think everything in the |
… "derive" feature
Do not use wildcard import for apache_avro_derive::* types
…AvroSchemaComponent::get_schema_in_ctxt() Fix docstring example
martin-g
commented
Jan 12, 2026
Kriskras99
requested changes
Jan 13, 2026
Comment on lines
+28
to
+42
| #[test] | ||
| fn avro_rs_394_avro_schema_component_nested_options() { | ||
| use apache_avro::{AvroSchemaComponent, Schema}; | ||
| use std::collections::HashMap; | ||
|
|
||
| type VeryOptional = Option<Option<Option<Option<Option<i32>>>>>; | ||
|
|
||
| let schema = VeryOptional::get_schema_in_ctxt(&mut HashMap::default(), &None); | ||
| match schema { | ||
| Schema::Union(union_schema) => { | ||
| assert_eq!(union_schema.variants(), &[Schema::Null, Schema::Int]); | ||
| } | ||
| _ => panic!("Unexpected schema type: {schema}"), | ||
| }; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| #[test] | |
| fn avro_rs_394_avro_schema_component_nested_options() { | |
| use apache_avro::{AvroSchemaComponent, Schema}; | |
| use std::collections::HashMap; | |
| type VeryOptional = Option<Option<Option<Option<Option<i32>>>>>; | |
| let schema = VeryOptional::get_schema_in_ctxt(&mut HashMap::default(), &None); | |
| match schema { | |
| Schema::Union(union_schema) => { | |
| assert_eq!(union_schema.variants(), &[Schema::Null, Schema::Int]); | |
| } | |
| _ => panic!("Unexpected schema type: {schema}"), | |
| }; | |
| } | |
| #[test] | |
| #[should_panic(expected = "Option<T> must produce a valid (non-nested) union")] | |
| fn avro_rs_394_avro_schema_component_nested_options() { | |
| use apache_avro::{AvroSchemaComponent, Schema}; | |
| use std::collections::HashMap; | |
| type VeryOptional = Option<Option<Option<Option<Option<i32>>>>>; | |
| let _schema = VeryOptional::get_schema_in_ctxt(&mut HashMap::default(), &None); | |
| } |
Co-authored-by: Kriskras99 <[email protected]>
Kriskras99
approved these changes
Jan 13, 2026
jklamer
reviewed
Jan 13, 2026
jklamer
left a comment
Contributor
There was a problem hiding this comment.
Hey, seems like a super reasonable change. Is this part of a larger workstream that is going on?
Contributor
|
We are currently revamping the Serde and I'm also personally working on async support ( |
Closed
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.
Fixes #363