From ec12f92566c7b30f46b3a710cc73c3f1ce576b46 Mon Sep 17 00:00:00 2001 From: William Parsley Date: Tue, 12 Dec 2023 12:30:29 -0600 Subject: [PATCH] printing stuff... --- .../transformation/transformation_service.go | 26 +++++++++++++++++++ .../transformation_service_test.go | 12 +++++++++ 2 files changed, 38 insertions(+) diff --git a/go/internal/feast/transformation/transformation_service.go b/go/internal/feast/transformation/transformation_service.go index 470e482aa0..0a0c61e8d6 100644 --- a/go/internal/feast/transformation/transformation_service.go +++ b/go/internal/feast/transformation/transformation_service.go @@ -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) diff --git a/go/internal/feast/transformation/transformation_service_test.go b/go/internal/feast/transformation/transformation_service_test.go index 8317e87c00..d2c6488d74 100644 --- a/go/internal/feast/transformation/transformation_service_test.go +++ b/go/internal/feast/transformation/transformation_service_test.go @@ -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)