Skip to content

Commit

Permalink
fix(featctl/cmd): fix command join_historical_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jinghancc committed Nov 12, 2021
1 parent 6813c56 commit 7878b60
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions featctl/cmd/join_historical_feature_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"

"github.com/olekukonko/tablewriter"
"github.com/oom-ai/oomstore/internal/database/metadatav2"
"github.com/oom-ai/oomstore/pkg/oomstore"
"github.com/oom-ai/oomstore/pkg/oomstore/types"
"github.com/spf13/cast"
Expand All @@ -25,11 +26,15 @@ func joinHistoricalFeatures(ctx context.Context, store *oomstore.OomStore, opt J
return err
}

// TODO: convert feature names into feature IDs
var featureIDs []int16
features := store.ListFeature(ctx, metadatav2.ListFeatureOpt{
FeatureNames: &opt.FeatureNames,
})
if err != nil {
return nil
}

joinResult, err := store.GetHistoricalFeatureValues(ctx, types.GetHistoricalFeatureValuesOpt{
FeatureIDs: featureIDs,
FeatureIDs: features.Ids(),
EntityRows: entityRows,
})
if err != nil {
Expand Down

0 comments on commit 7878b60

Please sign in to comment.