Skip to content

Commit 7dfc447

Browse files
fix: Handle @latest in Go feature server and pre-compile version regex
- Strip @latest suffix (equivalent to no version) instead of passing through as part of the FV name, which caused confusing "not found" errors - Pre-compile version tag regex to package-level var to avoid recompilation on every call in the hot path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ac0348d commit 7dfc447

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

go/internal/feast/onlineserving/serving.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"github.com/feast-dev/feast/go/types"
2222
)
2323

24+
var versionTagRegex = regexp.MustCompile(`^[vV]\d+$`)
25+
2426
/*
2527
FeatureVector type represent result of retrieving single feature for multiple rows.
2628
It can be imagined as a column in output dataframe / table.
@@ -494,14 +496,16 @@ func ParseFeatureReference(featureRef string) (featureViewName, featureName stri
494496
featureName = parsedFeatureName[1]
495497
}
496498

497-
// Reject @v<N> version qualifier — Go feature server does not support versioned reads
499+
// Handle @version qualifier on feature view name
498500
if atIdx := strings.Index(featureViewName, "@"); atIdx >= 0 {
499501
suffix := featureViewName[atIdx+1:]
500-
matched, _ := regexp.MatchString(`^[vV]\d+$`, suffix)
501-
if matched {
502+
if versionTagRegex.MatchString(suffix) {
502503
e = fmt.Errorf("versioned feature refs (@%s) are not supported by the Go feature server", suffix)
503504
return
504505
}
506+
if strings.EqualFold(suffix, "latest") {
507+
featureViewName = featureViewName[:atIdx]
508+
}
505509
}
506510
return
507511
}

0 commit comments

Comments
 (0)