From 9c3db7334e3fb8a6c39e9a2438dd0c1a1ac34334 Mon Sep 17 00:00:00 2001 From: Nathaniel Bauernfeind Date: Wed, 4 Dec 2024 21:50:56 -0700 Subject: [PATCH] fix go tests --- .../extensions/barrage/util/BarrageUtil.java | 3 +- go/internal/test_tools/test_tools.go | 6 +-- go/pkg/client/example_import_table_test.go | 54 +++++++++---------- go/pkg/client/example_table_ops_test.go | 8 +-- 4 files changed, 35 insertions(+), 36 deletions(-) diff --git a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageUtil.java b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageUtil.java index 562a2b0d3cc..3381bfff648 100755 --- a/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageUtil.java +++ b/extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageUtil.java @@ -436,8 +436,7 @@ public static Stream columnDefinitionsToFields( // user defined metadata should override the default metadata metadata.putAll(field.getMetadata()); final FieldType newType = - new FieldType(origType.isNullable(), origType.getType(), origType.getDictionary(), - origType.getMetadata()); + new FieldType(origType.isNullable(), origType.getType(), origType.getDictionary(), metadata); return new Field(field.getName(), newType, field.getChildren()); } diff --git a/go/internal/test_tools/test_tools.go b/go/internal/test_tools/test_tools.go index e786403eb19..67fd5cdbc47 100644 --- a/go/internal/test_tools/test_tools.go +++ b/go/internal/test_tools/test_tools.go @@ -18,9 +18,9 @@ import ( func ExampleRecord() arrow.Record { schema := arrow.NewSchema( []arrow.Field{ - {Name: "Ticker", Type: arrow.BinaryTypes.String}, - {Name: "Close", Type: arrow.PrimitiveTypes.Float32}, - {Name: "Volume", Type: arrow.PrimitiveTypes.Int32}, + {Name: "Ticker", Type: arrow.BinaryTypes.String, Nullable: true}, + {Name: "Close", Type: arrow.PrimitiveTypes.Float32, Nullable: true}, + {Name: "Volume", Type: arrow.PrimitiveTypes.Int32, Nullable: true}, }, nil, ) diff --git a/go/pkg/client/example_import_table_test.go b/go/pkg/client/example_import_table_test.go index 133f33445bc..a1310e13e57 100644 --- a/go/pkg/client/example_import_table_test.go +++ b/go/pkg/client/example_import_table_test.go @@ -71,31 +71,31 @@ func Example_importTable() { test_tools.RecordPrint(filteredRecord) // Output: - // Data Before: - // record: - // schema: - // fields: 3 - // - Ticker: type=utf8 - // - Close: type=float32 - // - Volume: type=int32 - // rows: 7 - // col[0][Ticker]: ["XRX" "XYZZY" "IBM" "GME" "AAPL" "ZNGA" "T"] - // col[1][Close]: [53.8 88.5 38.7 453 26.7 544.9 13.4] - // col[2][Volume]: [87000 6060842 138000 138000000 19000 48300 1500] - // - // Data After: - // record: - // schema: - // fields: 3 - // - Ticker: type=utf8, nullable - // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "java.lang.String"] - // - Close: type=float32, nullable - // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "float"] - // - Volume: type=int32, nullable - // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "int"] - // metadata: ["deephaven:attribute.AddOnly": "true", "deephaven:attribute.AppendOnly": "true", "deephaven:attribute.SortedColumns": "Close=Ascending", "deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute_type.AppendOnly": "java.lang.Boolean", "deephaven:attribute_type.SortedColumns": "java.lang.String"] - // rows: 5 - // col[0][Ticker]: ["IBM" "XRX" "XYZZY" "GME" "ZNGA"] - // col[1][Close]: [38.7 53.8 88.5 453 544.9] - // col[2][Volume]: [138000 87000 6060842 138000000 48300] + // Data Before: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8, nullable + // - Close: type=float32, nullable + // - Volume: type=int32, nullable + // rows: 7 + // col[0][Ticker]: ["XRX" "XYZZY" "IBM" "GME" "AAPL" "ZNGA" "T"] + // col[1][Close]: [53.8 88.5 38.7 453 26.7 544.9 13.4] + // col[2][Volume]: [87000 6060842 138000 138000000 19000 48300 1500] + // + // Data After: + // record: + // schema: + // fields: 3 + // - Ticker: type=utf8, nullable + // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "java.lang.String"] + // - Close: type=float32, nullable + // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "float"] + // - Volume: type=int32, nullable + // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "int"] + // metadata: ["deephaven:attribute.AddOnly": "true", "deephaven:attribute.AppendOnly": "true", "deephaven:attribute.SortedColumns": "Close=Ascending", "deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute_type.AppendOnly": "java.lang.Boolean", "deephaven:attribute_type.SortedColumns": "java.lang.String"] + // rows: 5 + // col[0][Ticker]: ["IBM" "XRX" "XYZZY" "GME" "ZNGA"] + // col[1][Close]: [38.7 53.8 88.5 453 544.9] + // col[2][Volume]: [138000 87000 6060842 138000000 48300] } diff --git a/go/pkg/client/example_table_ops_test.go b/go/pkg/client/example_table_ops_test.go index 7d361a773bf..00a55e8efb7 100644 --- a/go/pkg/client/example_table_ops_test.go +++ b/go/pkg/client/example_table_ops_test.go @@ -39,9 +39,9 @@ func Example_tableOps() { // record: // schema: // fields: 3 - // - Ticker: type=utf8 - // - Close: type=float32 - // - Volume: type=int32 + // - Ticker: type=utf8, nullable + // - Close: type=float32, nullable + // - Volume: type=int32, nullable // rows: 7 // col[0][Ticker]: ["XRX" "XYZZY" "IBM" "GME" "AAPL" "ZNGA" "T"] // col[1][Close]: [53.8 88.5 38.7 453 26.7 544.9 13.4] @@ -57,7 +57,7 @@ func Example_tableOps() { // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "float"] // - Volume: type=int32, nullable // metadata: ["deephaven:isDateFormat": "false", "deephaven:isNumberFormat": "false", "deephaven:isPartitioning": "false", "deephaven:isRowStyle": "false", "deephaven:isSortable": "true", "deephaven:isStyle": "false", "deephaven:type": "int"] - // metadata: ["deephaven:attribute.AddOnly": "true", "deephaven:attribute.AppendOnly": "true", "deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute_type.AppendOnly": "java.lang.Boolean"] + // metadata: ["deephaven:attribute.AddOnly": "true", "deephaven:attribute.AppendOnly": "true", "deephaven:attribute_type.AddOnly": "java.lang.Boolean", "deephaven:attribute_type.AppendOnly": "java.lang.Boolean", "deephaven:unsent.attribute.BarrageSchema": ""] // rows: 5 // col[0][Ticker]: ["XRX" "IBM" "GME" "AAPL" "ZNGA"] // col[1][Close]: [53.8 38.7 453 26.7 544.9]