Fix generate_unions_case for Rust case - #1677
Conversation
4896e43 to
2883adc
Compare
Codecov Report
@@ Coverage Diff @@
## master #1677 +/- ##
==========================================
- Coverage 83.10% 83.01% -0.10%
==========================================
Files 193 193
Lines 55881 55940 +59
==========================================
- Hits 46439 46436 -3
- Misses 9442 9504 +62
Continue to review full report at Codecov.
|
2883adc to
4372037
Compare
| )) | ||
| } | ||
| } | ||
| Some(s) if s == "union" => { |
There was a problem hiding this comment.
We don't parse union type from json before.
| } | ||
|
|
||
| #[test] | ||
| fn parse_union_from_json() { |
There was a problem hiding this comment.
I will work on union to json in another PR later.
| let default_fields = type_ids | ||
| .iter() | ||
| .map(|t| { | ||
| Field::new("", DataType::Boolean, true).with_metadata( |
There was a problem hiding this comment.
is it cool to have a field without a name 🤔
There was a problem hiding this comment.
This is only a placeholder, as above other nested types (list, map, etc) do. The actual fields will replace them (Field::from).
There was a problem hiding this comment.
This is because, type (union, map, list, etc) is defined in "type" of the Json map, fields are defined in "children" of the map. We parse "type" to get the nested type and parse "children" to get actual fields after that.
|
Merged, thanks @alamb ! |
Which issue does this PR close?
Closes #1676.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?