Skip to content

Commit

Permalink
fix(pkg/oomstore): make ExportFeatureValuesOpt.RevisionID required
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 12, 2021
1 parent acd677a commit fc58b8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions pkg/oomstore/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ func (s *OomStore) ExportFeatureValues(ctx context.Context, opt types.ExportFeat
return nil, nil, err
}

var dataTable string
if opt.Revision == nil {
revision, err := s.GetRevisionBy(ctx, opt.GroupID, *opt.Revision)
if err != nil {
return nil, nil, err
}
dataTable = revision.DataTable
revision, err := s.GetRevision(ctx, opt.RevisionID)
if err != nil {
return nil, nil, err
}

featureNames := opt.FeatureNames
Expand All @@ -47,7 +43,7 @@ func (s *OomStore) ExportFeatureValues(ctx context.Context, opt types.ExportFeat
}

stream, err := s.offline.Export(ctx, offline.ExportOpt{
DataTable: dataTable,
DataTable: revision.DataTable,
EntityName: entity.Name,
FeatureNames: featureNames,
Limit: opt.Limit,
Expand Down
2 changes: 1 addition & 1 deletion pkg/oomstore/types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type CreateFeatureGroupOpt struct {

type ExportFeatureValuesOpt struct {
GroupID int16
Revision *int64
RevisionID int32
FeatureNames []string
Limit *uint64
}
Expand Down

0 comments on commit fc58b8d

Please sign in to comment.