Skip to content

Commit

Permalink
Modifying go class and adding back build addition to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha4 committed Feb 27, 2025
1 parent 3eda833 commit 31ac265
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
- name: Upgrade pip version
run: |
pip install --upgrade "pip>=22.1,<23"
- name: Upgrade setuptools and wheel
run: pip install --upgrade setuptools wheel
- name: Test
run: make test-go

Expand Down
29 changes: 27 additions & 2 deletions go/internal/feast/model/sortedfeatureview.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,40 @@ import (
"github.com/feast-dev/feast/go/protos/feast/core"
)

type SortOrder struct {
Order core.SortOrder_Enum
}

func NewSortOrderFromProto(order core.SortOrder_Enum) *SortOrder {
return &SortOrder{
Order: order,
}
}

func (so *SortOrder) String() string {
switch so.Order {
case core.SortOrder_ASC:
return "ASC"
case core.SortOrder_DESC:
return "DESC"
default:
return "INVALID"
}
}

func (so *SortOrder) ToProto() core.SortOrder_Enum {
return so.Order
}

type SortKey struct {
FieldName string
Order string
Order *SortOrder
}

func NewSortKeyFromProto(proto *core.SortKey) *SortKey {
return &SortKey{
FieldName: proto.GetName(),
Order: proto.GetDefaultSortOrder().String(),
Order: NewSortOrderFromProto(proto.GetDefaultSortOrder()),
}
}

Expand Down

0 comments on commit 31ac265

Please sign in to comment.