Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
39733b2
Switch `entities` from List[str] to List[Entity]
felixwang9817 Apr 25, 2022
a6a675b
Remove `value_type` from SDK
felixwang9817 Apr 26, 2022
10523c7
Remove `value_type` from tests
felixwang9817 Apr 26, 2022
705e952
Deprecate `value_type` parameter for Entity
felixwang9817 May 2, 2022
afbb5dd
Add fields for entities to avoid type inference after removing `value…
felixwang9817 Apr 26, 2022
c66976c
Fix Go
felixwang9817 May 2, 2022
00bb4d8
Fix type inference
felixwang9817 May 3, 2022
bc88d5c
Another fix
felixwang9817 May 3, 2022
a4d8e44
Another fix
felixwang9817 May 3, 2022
3dfa9d6
Rename Entities to EntityNames in go
felixwang9817 May 3, 2022
49b01b4
Rename lookup
felixwang9817 May 3, 2022
ac31bb7
Rename Feature to Field
felixwang9817 May 3, 2022
a2158e7
Clean up inference
felixwang9817 May 3, 2022
aad0805
Refactor
felixwang9817 May 3, 2022
21d7e55
Use old `value_type` attribute if it still exists
felixwang9817 May 3, 2022
dc750e8
Refactor
felixwang9817 May 3, 2022
6432029
Add TODO
felixwang9817 May 4, 2022
9808789
Another fix
felixwang9817 May 11, 2022
6c92dc2
Fix test
felixwang9817 May 11, 2022
2be1e40
Add pytest.ini file to suppress pytest warnings about markers
felixwang9817 May 11, 2022
9b341b7
Fix type test
felixwang9817 May 11, 2022
2ed0384
Fix type test
felixwang9817 May 13, 2022
7c5b80d
Modify entity and feature inference to occur separately and add tests
felixwang9817 May 13, 2022
0f129d3
Lint
felixwang9817 May 13, 2022
18fbb0d
Refactor inference to pass lint
felixwang9817 May 13, 2022
7a32b01
Fix Java
felixwang9817 May 13, 2022
6c4e9d6
Another fix
felixwang9817 May 13, 2022
d23ee23
Fix ODFV repo
felixwang9817 May 17, 2022
8eaa65c
Switch deprecation version from 0.22 to 0.23
felixwang9817 May 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename Feature to Field
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed May 17, 2022
commit ac31bb7b1450abbd379dc828a853ea752b26e4c0
8 changes: 4 additions & 4 deletions go/internal/feast/model/basefeatureview.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (

type BaseFeatureView struct {
Name string
Features []*Feature
Features []*Field
Projection *FeatureViewProjection
}

func NewBaseFeatureView(name string, featureProtos []*core.FeatureSpecV2) *BaseFeatureView {
base := &BaseFeatureView{Name: name}
features := make([]*Feature, len(featureProtos))
features := make([]*Field, len(featureProtos))
for index, featureSpecV2 := range featureProtos {
features[index] = NewFeatureFromProto(featureSpecV2)
features[index] = NewFieldFromProto(featureSpecV2)
}
base.Features = features
base.Projection = NewFeatureViewProjectionFromDefinition(base)
Expand All @@ -43,7 +43,7 @@ func (fv *BaseFeatureView) WithProjection(projection *FeatureViewProjection) (*B
}

func (fv *BaseFeatureView) ProjectWithFeatures(featureNames []string) *FeatureViewProjection {
features := make([]*Feature, 0)
features := make([]*Field, 0)
for _, feature := range fv.Features {
for _, allowedFeatureName := range featureNames {
if feature.Name == allowedFeatureName {
Expand Down
6 changes: 3 additions & 3 deletions go/internal/feast/model/featureview.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type FeatureView struct {
Base *BaseFeatureView
Ttl *durationpb.Duration
EntityNames []string
EntityColumns []*Feature
EntityColumns []*Field
}

func NewFeatureViewFromProto(proto *core.FeatureView) *FeatureView {
Expand All @@ -31,9 +31,9 @@ func NewFeatureViewFromProto(proto *core.FeatureView) *FeatureView {
} else {
featureView.EntityNames = proto.Spec.Entities
}
entityColumns := make([]*Feature, len(proto.Spec.EntityColumns))
entityColumns := make([]*Field, len(proto.Spec.EntityColumns))
for i, entityColumn := range proto.Spec.EntityColumns {
entityColumns[i] = NewFeatureFromProto(entityColumn)
entityColumns[i] = NewFieldFromProto(entityColumn)
}
featureView.EntityColumns = entityColumns
return featureView
Expand Down
6 changes: 3 additions & 3 deletions go/internal/feast/model/featureviewprojection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
type FeatureViewProjection struct {
Name string
NameAlias string
Features []*Feature
Features []*Field
JoinKeyMap map[string]string
}

Expand All @@ -24,9 +24,9 @@ func NewFeatureViewProjectionFromProto(proto *core.FeatureViewProjection) *Featu
JoinKeyMap: proto.JoinKeyMap,
}

features := make([]*Feature, len(proto.FeatureColumns))
features := make([]*Field, len(proto.FeatureColumns))
for index, featureSpecV2 := range proto.FeatureColumns {
features[index] = NewFeatureFromProto(featureSpecV2)
features[index] = NewFieldFromProto(featureSpecV2)
}
featureProjection.Features = features
return featureProjection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import (
"github.com/feast-dev/feast/go/protos/feast/types"
)

type Feature struct {
type Field struct {
Name string
Dtype types.ValueType_Enum
}

func NewFeatureFromProto(proto *core.FeatureSpecV2) *Feature {
return &Feature{Name: proto.Name,
func NewFieldFromProto(proto *core.FeatureSpecV2) *Field {
return &Field{
Name: proto.Name,
Dtype: proto.ValueType,
}
}
30 changes: 15 additions & 15 deletions go/internal/feast/server/logging/featureserviceschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,69 +126,69 @@ func TestSchemaUsesOrderInFeatureService(t *testing.T) {

// Initialize all dummy featureservice, entities and featureviews/on demand featureviews for testing.
func InitializeFeatureRepoVariablesForTest() (*model.FeatureService, []*model.Entity, []*model.FeatureView, []*model.OnDemandFeatureView) {
f1 := test.CreateNewFeature(
f1 := test.CreateNewField(
"int64",
types.ValueType_INT64,
)
f2 := test.CreateNewFeature(
f2 := test.CreateNewField(
"float32",
types.ValueType_FLOAT,
)
projection1 := test.CreateNewFeatureViewProjection(
"featureView1",
"",
[]*model.Feature{f1, f2},
[]*model.Field{f1, f2},
map[string]string{},
)
baseFeatureView1 := test.CreateBaseFeatureView(
"featureView1",
[]*model.Feature{f1, f2},
[]*model.Field{f1, f2},
projection1,
)
entity1 := test.CreateNewEntity("driver_id", "driver_id")
entitycolumn1 := test.CreateNewFeature(
entitycolumn1 := test.CreateNewField(
"driver_id",
types.ValueType_INT64,
)
featureView1 := test.CreateFeatureView(baseFeatureView1, nil, []string{"driver_id"}, []*model.Feature{entitycolumn1})
f3 := test.CreateNewFeature(
featureView1 := test.CreateFeatureView(baseFeatureView1, nil, []string{"driver_id"}, []*model.Field{entitycolumn1})
f3 := test.CreateNewField(
"int32",
types.ValueType_INT32,
)
f4 := test.CreateNewFeature(
f4 := test.CreateNewField(
"double",
types.ValueType_DOUBLE,
)
projection2 := test.CreateNewFeatureViewProjection(
"featureView2",
"",
[]*model.Feature{f3, f4},
[]*model.Field{f3, f4},
map[string]string{},
)
baseFeatureView2 := test.CreateBaseFeatureView(
"featureView2",
[]*model.Feature{f3, f4},
[]*model.Field{f3, f4},
projection2,
)
featureView2 := test.CreateFeatureView(baseFeatureView2, nil, []string{"driver_id"}, []*model.Feature{entitycolumn1})
featureView2 := test.CreateFeatureView(baseFeatureView2, nil, []string{"driver_id"}, []*model.Field{entitycolumn1})

f5 := test.CreateNewFeature(
f5 := test.CreateNewField(
"odfv_f1",
types.ValueType_INT32,
)
f6 := test.CreateNewFeature(
f6 := test.CreateNewField(
"odfv_f2",
types.ValueType_DOUBLE,
)
projection3 := test.CreateNewFeatureViewProjection(
"od_bf1",
"",
[]*model.Feature{f5, f6},
[]*model.Field{f5, f6},
map[string]string{},
)
od_bf1 := test.CreateBaseFeatureView(
"od_bf1",
[]*model.Feature{f5, f6},
[]*model.Field{f5, f6},
projection3,
)
odfv := model.NewOnDemandFeatureViewFromBase(od_bf1)
Expand Down
10 changes: 5 additions & 5 deletions go/internal/test/go_integration_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func GetProtoFromRecord(rec arrow.Record) (map[string]*types.RepeatedValue, erro
return r, nil
}

func CreateBaseFeatureView(name string, features []*model.Feature, projection *model.FeatureViewProjection) *model.BaseFeatureView {
func CreateBaseFeatureView(name string, features []*model.Field, projection *model.FeatureViewProjection) *model.BaseFeatureView {
return &model.BaseFeatureView{
Name: name,
Features: features,
Expand All @@ -208,8 +208,8 @@ func CreateNewEntity(name string, joinKey string) *model.Entity {
}
}

func CreateNewFeature(name string, dtype types.ValueType_Enum) *model.Feature {
return &model.Feature{Name: name,
func CreateNewField(name string, dtype types.ValueType_Enum) *model.Field {
return &model.Field{Name: name,
Dtype: dtype,
}
}
Expand All @@ -224,15 +224,15 @@ func CreateNewFeatureService(name string, project string, createdTimestamp *time
}
}

func CreateNewFeatureViewProjection(name string, nameAlias string, features []*model.Feature, joinKeyMap map[string]string) *model.FeatureViewProjection {
func CreateNewFeatureViewProjection(name string, nameAlias string, features []*model.Field, joinKeyMap map[string]string) *model.FeatureViewProjection {
return &model.FeatureViewProjection{Name: name,
NameAlias: nameAlias,
Features: features,
JoinKeyMap: joinKeyMap,
}
}

func CreateFeatureView(base *model.BaseFeatureView, ttl *durationpb.Duration, entities []string, entityColumns []*model.Feature) *model.FeatureView {
func CreateFeatureView(base *model.BaseFeatureView, ttl *durationpb.Duration, entities []string, entityColumns []*model.Field) *model.FeatureView {
return &model.FeatureView{
Base: base,
Ttl: ttl,
Expand Down