Skip to content

Commit 110a1c3

Browse files
committed
Address review issues
Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
1 parent c9ad601 commit 110a1c3

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

go/internal/feast/featurestore.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,17 @@ func (fs *FeatureStore) listFeatureViews(hideDummyEntity bool) ([]*FeatureView,
654654
if err != nil {
655655
return featureViews, err
656656
}
657-
for _, featureView := range featureViews {
658-
if _, ok := featureView.entities[DUMMY_ENTITY_NAME]; ok && hideDummyEntity {
659-
featureView.entities = make(map[string]struct{})
660-
}
661-
}
662657
return featureViews, nil
663658
}
664659

660+
func (fs *FeatureStore) listRequestFeatureViews() ([]*RequestFeatureView, error) {
661+
requestFeatureViews, err := fs.registry.listRequestFeatureViews(fs.config.Project)
662+
if err != nil {
663+
return requestFeatureViews, err
664+
}
665+
return requestFeatureViews, nil
666+
}
667+
665668
func (fs *FeatureStore) listEntities(hideDummyEntity bool) ([]*Entity, error) {
666669

667670
allEntities, err := fs.registry.listEntities(fs.config.Project)

go/internal/feast/registry.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ var REGISTRY_STORE_CLASS_FOR_SCHEME map[string]string = map[string]string{
2424
*/
2525

2626
type Registry struct {
27-
registryStore RegistryStore
28-
cachedFeatureServices map[string]map[string]*core.FeatureService
29-
cachedEntities map[string]map[string]*core.Entity
30-
cachedFeatureViews map[string]map[string]*core.FeatureView
31-
cachedOnDemandFeatureViews map[string]map[string]*core.OnDemandFeatureView
32-
cachedRequestFeatureViews map[string]map[string]*core.RequestFeatureView
33-
cachedRegistry *core.Registry
34-
cachedRegistryProtoCreated time.Time
35-
cachedRegistryProtoTtl time.Duration
36-
mu sync.Mutex
27+
registryStore RegistryStore
28+
cachedFeatureServices map[string]map[string]*core.FeatureService
29+
cachedEntities map[string]map[string]*core.Entity
30+
cachedFeatureViews map[string]map[string]*core.FeatureView
31+
cachedOnDemandFeatureViews map[string]map[string]*core.OnDemandFeatureView
32+
cachedRequestFeatureViews map[string]map[string]*core.RequestFeatureView
33+
cachedRegistry *core.Registry
34+
cachedRegistryProtoLastUpdated time.Time
35+
cachedRegistryProtoTtl time.Duration
36+
mu sync.Mutex
3737
}
3838

3939
func NewRegistry(registryConfig *RegistryConfig, repoPath string) (*Registry, error) {
@@ -86,7 +86,7 @@ func (r *Registry) refresh() error {
8686
}
8787

8888
func (r *Registry) getRegistryProto() (*core.Registry, error) {
89-
expired := r.cachedRegistry == nil || (r.cachedRegistryProtoTtl > 0 && time.Now().After(r.cachedRegistryProtoCreated.Add(r.cachedRegistryProtoTtl)))
89+
expired := r.cachedRegistry == nil || (r.cachedRegistryProtoTtl > 0 && time.Now().After(r.cachedRegistryProtoLastUpdated.Add(r.cachedRegistryProtoTtl)))
9090
if !expired {
9191
return r.cachedRegistry, nil
9292
}
@@ -112,7 +112,7 @@ func (r *Registry) load(registry *core.Registry) {
112112
r.loadFeatureViews(registry)
113113
r.loadOnDemandFeatureViews(registry)
114114
r.loadRequestFeatureViews(registry)
115-
r.cachedRegistryProtoCreated = time.Now()
115+
r.cachedRegistryProtoLastUpdated = time.Now()
116116
}
117117

118118
func (r *Registry) loadEntities(registry *core.Registry) {

0 commit comments

Comments
 (0)