Skip to content

Commit

Permalink
printing more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
William Parsley committed Dec 12, 2023
1 parent ec12f92 commit 948c70e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 36 deletions.
18 changes: 18 additions & 0 deletions go/internal/feast/featurestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/apache/arrow/go/v8/arrow/memory"
"github.com/apache/arrow/go/v8/arrow/array"

"github.com/feast-dev/feast/go/internal/feast/model"
"github.com/feast-dev/feast/go/internal/feast/onlineserving"
Expand Down Expand Up @@ -174,6 +175,23 @@ func (fs *FeatureStore) GetOnlineFeatures(
result = append(result, vectors...)
}

for i, arr := range result {
fmt.Println(i)
switch col := arr.Values.(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())
}
}


if fs.transformationCallback != nil || fs.transformationService != nil {
onDemandFeatures, err := transformation.AugmentResponseWithOnDemandTransforms(
ctx,
Expand Down
24 changes: 0 additions & 24 deletions go/internal/feast/transformation/transformation_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,11 @@ func (s *GrpcTransformationService) GetTransformation(
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: 0 additions & 12 deletions go/internal/feast/transformation/transformation_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ 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 948c70e

Please sign in to comment.