Skip to content

[WIP] Add golang SDK#261

Merged
woop merged 4 commits into
feast-dev:0.3-devfrom
zhilingc:zl/0.3-dev-go-sdk
Oct 21, 2019
Merged

[WIP] Add golang SDK#261
woop merged 4 commits into
feast-dev:0.3-devfrom
zhilingc:zl/0.3-dev-go-sdk

Conversation

@zhilingc
Copy link
Copy Markdown
Collaborator

@zhilingc zhilingc commented Oct 17, 2019

Addresses #260 .

Some considerations:

  • The protobuf defined request and response payloads are not very user friendly, so we need wrappers around them
  • Performance is of great importance for this SDK so we want to avoid reflection as much as possible
  • Most feast usecases deal with single-type arrays of features, but there are usecases that involve mixed type outputs, so we have to support both

@feast-ci-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zhilingc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhilingc
Copy link
Copy Markdown
Collaborator Author

Usage example for the current iteration:

client, err := NewGrpcClient("localhost", 6565)
if err != nil {
	panic(err)
}
ctx := context.Background()
response, err := client.GetOnlineFeatures(ctx, &OnlineFeaturesRequest{
	Features:      []string{"fs:1:feature1", "fs:1:feature2"},
	MaxAgeSeconds: 100,
	Entities: []Row{
		{"s2id": Int64Val(1)},
		{"s2id": Int64Val(2)},
	},
})
if err != nil {
	panic(err)
}

// just retrieve rows
// returns map[string]*types.Value
_ = response.Rows()

// use convenience functions to get arrays
// returns [][]int64
_, err = response.Int64Arrays([]string{"fs:1:feature1", "fs:1:feature2"}, []int64{-1, -1})

Copy link
Copy Markdown
Member

@woop woop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good! I like the construction of the request

Comment thread sdk/go/request.go Outdated
Comment thread sdk/go/request.go Outdated
Comment thread sdk/go/request.go Outdated
@feast-ci-bot
Copy link
Copy Markdown
Collaborator

@zhilingc: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
integration-test 4821cf5 link /test integration-test
unit-test-cli 4821cf5 link /test unit-test-cli
unit-test-ingestion 4821cf5 link /test unit-test-ingestion

Full PR test history

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@woop woop merged commit e8a9fae into feast-dev:0.3-dev Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants