zeroshade commented on code in PR #1526:
URL: https://github.com/apache/arrow-go/pull/1526#discussion_r4543869703


##########
arrow/cdata/cdata_test.go:
##########
@@ -1191,6 +1193,50 @@ func TestEmptyUnionExport(t *testing.T) {
        assert.NotEqualValues(t, unsafe.Pointer(nil), buffers[0])
 }
 
+func TestExtensionArrayRoundTrip(t *testing.T) {
+       tests := []struct {
+               name     string
+               storage  arrow.DataType
+               json     string
+               nbuffers int
+       }{
+               {"string_view", arrow.BinaryTypes.StringView, `["a", null, 
"longer than twelve bytes"]`, 4},
+               {"sparse_union", arrow.SparseUnionOf([]arrow.Field{{Name: "i", 
Type: arrow.PrimitiveTypes.Int32, Nullable: true}}, []arrow.UnionTypeCode{0}), 
`[[0, 1], [0, null]]`, 1},
+               {"dictionary", &arrow.DictionaryType{IndexType: 
arrow.PrimitiveTypes.Int8, ValueType: arrow.BinaryTypes.String}, `["a", null, 
"b", "a"]`, 2},

Review Comment:
   nit: could you add a list (or struct) storage case? The issue's own 
reproduction is the missing-children failure (`expected 1 children ... 
ArrowArray has 0`), and none of these three cases exercises exporting the 
storage's children. Something like `{"list", 
arrow.ListOf(arrow.PrimitiveTypes.Int32), `[[1, 2], null, []]`, 2}` should do 
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]

Reply via email to