Skip to content

Commit

Permalink
printing stuff...
Browse files Browse the repository at this point in the history
  • Loading branch information
William Parsley committed Dec 12, 2023
1 parent 567719b commit ec12f92
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
26 changes: 26 additions & 0 deletions go/internal/feast/transformation/transformation_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,39 @@ func (s *GrpcTransformationService) GetTransformation(

inputFields := make([]arrow.Field, 0)
inputColumns := make([]arrow.Array, 0)
fmt.Println("Printing retrieved features")
for name, arr := range retrievedFeatures {
inputFields = append(inputFields, arrow.Field{Name: name, Type: arr.DataType()})
inputColumns = append(inputColumns, arr)
switch col := arr.(type) {
case *array.Int64:
fmt.Println(col.Int64Values())
case *array.Int32:
fmt.Println(col.Int32Values())
case *array.String:
fmt.Println(col.String())
case *array.Float32:
fmt.Println(col.Float32Values())
case *array.Float64:
fmt.Println(col.Float64Values())
}
}
fmt.Println("Printing request features")
for name, arr := range requestContext {
inputFields = append(inputFields, arrow.Field{Name: name, Type: arr.DataType()})
inputColumns = append(inputColumns, arr)
switch col := arr.(type) {
case *array.Int64:
fmt.Println(col.Int64Values())
case *array.Int32:
fmt.Println(col.Int32Values())
case *array.String:
fmt.Println(col.String())
case *array.Float32:
fmt.Println(col.Float32Values())
case *array.Float64:
fmt.Println(col.Float64Values())
}
}

inputSchema := arrow.NewSchema(inputFields, nil)
Expand Down
12 changes: 12 additions & 0 deletions go/internal/feast/transformation/transformation_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ func TestSendGrpcRequest(t *testing.T) {
}
inputFields = append(inputFields, arrow.Field{Name: fmt.Sprintf("Field %d", i), Type: &arrow.Int64Type{}})
inputColumns = append(inputColumns, dummyColumn.NewArray())
switch col := inputColumns[i].(type) {
case *array.Int64:
fmt.Println(col.Int64Values())
case *array.Int32:
fmt.Println(col.Int32Values())
case *array.String:
fmt.Println(col.String())
case *array.Float32:
fmt.Println(col.Float32Values())
case *array.Float64:
fmt.Println(col.Float64Values())
}
}

inputSchema := arrow.NewSchema(inputFields, nil)
Expand Down

0 comments on commit ec12f92

Please sign in to comment.