Skip to content

Commit a4752a1

Browse files
Ly Caoachals
authored andcommitted
lint-go + cleaned go code + handle BrokenPipeError in go_server.py
Signed-off-by: Felix Wang <wangfelix98@gmail.com> Signed-off-by: Achal Shah <achals@gmail.com>
1 parent a6fdd6d commit a4752a1

36 files changed

Lines changed: 185 additions & 3609 deletions

go/feast/basefeatureview.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ func NewBaseFeatureView(name string, featureProtos []*core.FeatureSpecV2) *BaseF
2525

2626
func (fv *BaseFeatureView) withProjection(projection *FeatureViewProjection) (*BaseFeatureView, error) {
2727
if projection.name != fv.name {
28-
return nil, errors.New(fmt.Sprintf("The projection for the %s FeatureView cannot be applied because it differs in name. " +
29-
"The projection is named %s and the name indicates which " +
30-
"FeatureView the projection is for.", fv.name, projection.name))
28+
return nil, errors.New(fmt.Sprintf( "The projection for the %s FeatureView cannot be applied because it differs in name. " +
29+
"The projection is named %s and the name indicates which " +
30+
"FeatureView the projection is for.", fv.name, projection.name))
3131
}
3232
features := make(map[string]bool)
3333
for _, feature := range fv.features {
3434
features[feature.name] = true
3535
}
3636
for _, feature := range projection.features {
3737
if _, ok := features[feature.name]; !ok {
38-
return nil, errors.New(fmt.Sprintf("The projection for %s cannot be applied because it contains %s which the " +
38+
return nil, errors.New(fmt.Sprintf( "The projection for %s cannot be applied because it contains %s which the " +
3939
"FeatureView doesn't have.", projection.name, feature.name))
4040
}
4141
}

go/feast/connector.go

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ package feast
33
import (
44
"errors"
55
"fmt"
6-
// "os"
7-
"os/exec"
8-
"github.com/hashicorp/go-plugin"
9-
// "github.com/hashicorp/go-hclog"
10-
"log"
11-
"io/ioutil"
126
)
137

148
func getOnlineStore(config *RepoConfig) (OnlineStore, error) {
@@ -20,57 +14,6 @@ func getOnlineStore(config *RepoConfig) (OnlineStore, error) {
2014
onlineStore, err := NewRedisOnlineStore(config.Project, config.OnlineStore)
2115
return onlineStore, err
2216
} else {
23-
// TODO(willem): Python connectors here
24-
KV_PLUGIN := config.OnlineStore["KV_PLUGIN"].(string)
25-
return connectorClient(KV_PLUGIN)
17+
return nil, errors.New("Only Redis is supported as an online store for now")
2618
}
27-
}
28-
29-
func connectorClient(KV_PLUGIN string) (OnlineStore, error) {
30-
// We don't want to see the plugin logs.
31-
log.SetOutput(ioutil.Discard)
32-
33-
// We're a host. Start by launching the plugin process.
34-
cmd := exec.Command("sh", "-c", KV_PLUGIN )
35-
36-
// logger := hclog.New(&hclog.LoggerOptions{
37-
// Name: "plugin",
38-
// Output: os.Stdout,
39-
// Level: hclog.Debug,
40-
// })
41-
42-
client := plugin.NewClient(&plugin.ClientConfig{
43-
HandshakeConfig: Handshake,
44-
Plugins: PluginMap,
45-
Cmd: cmd,
46-
AllowedProtocols: []plugin.Protocol{
47-
plugin.ProtocolGRPC},
48-
// Logger: logger,
49-
})
50-
51-
// Connect via RPC
52-
rpcClient, err := client.Client()
53-
if err != nil {
54-
return nil, err
55-
}
56-
// Request the plugin
57-
raw, err := rpcClient.Dispense("onlinestore_grpc")
58-
if err != nil {
59-
return nil, err
60-
}
61-
62-
// We should have a OnlineStore now! This feels like a normal interface
63-
// implementation but is in fact over an RPC connection.
64-
if onlineStore, ok := raw.(OnlineStore); !ok {
65-
return nil, errors.New("Error creating a Connector OnlineStore")
66-
} else {
67-
grpcClient, ok := onlineStore.(*GRPCClient)
68-
if !ok {
69-
return nil, errors.New("Connector is not a *connector.GrpcClient")
70-
}
71-
grpcClient.destructor = func() {
72-
client.Kill()
73-
}
74-
return onlineStore, nil
75-
}
76-
}
19+
}

go/feast/feature_store_integration_test.go

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)