diff --git a/sdk/go/client.go b/sdk/go/client.go index 38c9e2fb7e..ef8ec8b8cf 100644 --- a/sdk/go/client.go +++ b/sdk/go/client.go @@ -52,7 +52,7 @@ func (fc *GrpcClient) GetOnlineFeatures(ctx context.Context, req *OnlineFeatures resp, err := fc.cli.GetOnlineFeatures(ctx, featuresRequest) // collect unqiue entity refs from entity rows - var entityRefs map[string]struct{} + entityRefs := make(map[string]struct{}) for _, entityRows := range req.Entities { for ref, _ := range entityRows { entityRefs[ref] = struct{}{} @@ -61,7 +61,7 @@ func (fc *GrpcClient) GetOnlineFeatures(ctx context.Context, req *OnlineFeatures // strip projects from to projects for _, fieldValue := range resp.GetFieldValues() { - var stripFields map[string]*types.Value + stripFields := make(map[string]*types.Value) for refStr, value := range fieldValue.Fields { _, isEntity := entityRefs[refStr] if !isEntity { // is feature ref @@ -69,9 +69,9 @@ func (fc *GrpcClient) GetOnlineFeatures(ctx context.Context, req *OnlineFeatures if err != nil { return nil, err } - stripRefStr := toFeatureRefStr(featureRef) - stripFields[stripRefStr] = value + refStr = toFeatureRefStr(featureRef) } + stripFields[refStr] = value } fieldValue.Fields = stripFields } diff --git a/sdk/go/types.go b/sdk/go/types.go index 7fe400e45b..dd6553163b 100644 --- a/sdk/go/types.go +++ b/sdk/go/types.go @@ -21,12 +21,12 @@ func (r Row) equalTo(other Row) bool { return true } -// StrVal is a int64 type feast value +// StrVal is a string type feast value func StrVal(val string) *types.Value { return &types.Value{Val: &types.Value_StringVal{StringVal: val}} } -// Int32Val is a int64 type feast value +// Int32Val is a int32 type feast value func Int32Val(val int32) *types.Value { return &types.Value{Val: &types.Value_Int32Val{Int32Val: val}} } diff --git a/sdk/java/src/main/java/com/gojek/feast/FeastClient.java b/sdk/java/src/main/java/com/gojek/feast/FeastClient.java index c6e7edd076..a81fdab21a 100644 --- a/sdk/java/src/main/java/com/gojek/feast/FeastClient.java +++ b/sdk/java/src/main/java/com/gojek/feast/FeastClient.java @@ -23,6 +23,7 @@ import feast.proto.serving.ServingAPIProto.GetOnlineFeaturesRequest.EntityRow; import feast.proto.serving.ServingAPIProto.GetOnlineFeaturesResponse; import feast.proto.serving.ServingServiceGrpc; +import feast.proto.serving.ServingServiceGrpc.ServingServiceBlockingStub; import feast.proto.types.ValueProto.Value; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; @@ -40,7 +41,7 @@ public class FeastClient implements AutoCloseable { private static final int CHANNEL_SHUTDOWN_TIMEOUT_SEC = 5; private final ManagedChannel channel; - private final ServingServiceGrpc.ServingServiceBlockingStub stub; + private final ServingServiceBlockingStub stub; /** * Create a client to access Feast @@ -161,9 +162,9 @@ public List getOnlineFeatures( .collect(Collectors.toList()); } - private FeastClient(ManagedChannel channel) { + protected FeastClient(ManagedChannel channel) { this.channel = channel; - stub = ServingServiceGrpc.newBlockingStub(channel); + this.stub = ServingServiceGrpc.newBlockingStub(channel); } public void close() throws Exception { diff --git a/sdk/java/src/main/java/com/gojek/feast/Row.java b/sdk/java/src/main/java/com/gojek/feast/Row.java index 2ac2581cac..4a3035f8f1 100644 --- a/sdk/java/src/main/java/com/gojek/feast/Row.java +++ b/sdk/java/src/main/java/com/gojek/feast/Row.java @@ -76,7 +76,7 @@ public Row set(String fieldName, Object value) { fields.put( fieldName, Value.newBuilder().setBytesVal(ByteString.copyFrom((byte[]) value)).build()); break; - case "feast.types.ValueProto.Value": + case "feast.proto.types.ValueProto.Value": fields.put(fieldName, (Value) value); break; default: diff --git a/sdk/python/feast/test_feature.py b/sdk/python/tests/test_feature.py similarity index 92% rename from sdk/python/feast/test_feature.py rename to sdk/python/tests/test_feature.py index a4f0ff58ff..bc83683e0f 100644 --- a/sdk/python/feast/test_feature.py +++ b/sdk/python/tests/test_feature.py @@ -17,7 +17,7 @@ class TestFeatureRef: def test_str_ref(self): - original_ref = FeatureRef(project="test", name="test") + original_ref = FeatureRef(feature_set="test", name="test") ref_str = repr(original_ref) parsed_ref = FeatureRef.from_str(ref_str) assert original_ref == parsed_ref