zeroshade commented on code in PR #43555:
URL: https://github.com/apache/arrow/pull/43555#discussion_r1718953923
##########
go/arrow/util/protobuf_reflect_test.go:
##########
@@ -87,16 +185,87 @@ func TestGetSchema(t *testing.T) {
- message: type=struct<field1: utf8>, nullable
- oneofstring: type=utf8, nullable
- oneofmessage: type=struct<field1: utf8>, nullable
- - any: type=struct<field1: utf8>, nullable
- simple_map: type=map<int32, utf8, items_nullable>, nullable
- complex_map: type=map<utf8, struct<field1: utf8>, items_nullable>,
nullable
- simple_list: type=list<item: utf8, nullable>, nullable
- complex_list: type=list<item: struct<field1: utf8>, nullable>, nullable`
- require.Equal(t, want, got, "got: %s\nwant: %s", got, want)
+ jsonStr := `{
+ "str":"Hello",
+ "int32":10,
+ "int64":100,
+ "sint32":-10,
+ "sin64":-100,
+ "uint32":10,
+ "uint64":100,
+ "fixed32":10,
+ "fixed64":1000,
+ "sfixed32":10,
+ "bool":false,
+ "bytes":"SGVsbG8sIHdvcmxkIQ==",
+ "double":1.1,
+ "enum":"OPTION_1",
+ "message":{"field1":"Example"},
+ "oneofmessage": { "field1": null },
+ "oneofstring": "World",
+ "simple_map":[{"key":99,"value":"Hello"}],
+
"complex_map":[{"key":"complex","value":{"field1":"Example"}}],
+ "simple_list":["Hello","World"],
+ "complex_list":[{"field1":"Example"}]
+ }`
+
//[{"all_the_types_no_any_a":[{"bool":false,"bytes":"SGVsbG8sIHdvcmxkIQ==","complex_list":[{"field1":"Example"}],"complex_map":[{"key":"complex","value":{"field1":"Example"}}],"double":1.1,"enum":"OPTION_1","fixed32":10,"fixed64":1000,"int32":10,"int64":100,"message":{"field1":"Example"},"oneofmessage":{"field1":null},"oneofstring":"World","sfixed32":10,"simple_list":["Hello","World"],"simple_map":[{"key":99,"value":"Hello"}],"sin64":-100,"sint32":-10,"str":"Hello","uint32":10,"uint64":100}],"all_the_types_no_any_b":[{"bool":false,"bytes":"SGVsbG8sIHdvcmxkIQ==","complex_list":[{"field1":"Example"}],"complex_map":[{"key":"complex","value":{"field1":"Example"}}],"double":1.1,"enum":"OPTION_1","fixed32":10,"fixed64":1000,"int32":10,"int64":100,"message":{"field1":"Example"},"oneofmessage":{"field1":null},"oneofstring":"World","sfixed32":10,"simple_list":["Hello","World"],"simple_map":[{"key":99,"value":"Hello"}],"sin64":-100,"sint32":-10,"str":"Hello","uint32":10,"uint64":100}]}]
- got = NewProtobufMessageReflection(&msg,
WithOneOfHandler(OneOfDenseUnion)).Schema().String()
- want = `schema:
+ //nullJsonStr := ` {
+ // "str":"",
+ // "int32":0,
+ // "int64":0,
+ // "sint32":0,
+ // "sin64":0,
+ // "uint32":0,
+ // "uint64":0,
+ // "fixed32":0,
+ // "fixed64":0,
+ // "sfixed32":0,
+ // "bool":false,
+ // "bytes":"",
+ // "double":0,
+ // "enum":"OPTION_0",
+ // "message":null,
+ // "oneofmessage":{"field1":""},
+ // "oneofstring":"",
+ // "simple_map":[],
+ // "complex_map":[],
+ // "simple_list":[],
+ // "complex_list":[]
Review Comment:
Does this comment need to be here? Can we remove it?
--
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]