Skip to content

Commit

Permalink
fix go tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind committed Dec 5, 2024
1 parent 2dba609 commit 9c3db73
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,7 @@ public static Stream<Field> 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());
}

Expand Down
6 changes: 3 additions & 3 deletions go/internal/test_tools/test_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
54 changes: 27 additions & 27 deletions go/pkg/client/example_import_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
8 changes: 4 additions & 4 deletions go/pkg/client/example_table_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit 9c3db73

Please sign in to comment.