MCPcopy Index your code
hub / github.com/feast-dev/feast / ParseFeatureReference

Function ParseFeatureReference

go/internal/feast/onlineserving/serving.go:487–511  ·  view source on GitHub ↗
(featureRef string)

Source from the content-addressed store, hash-verified

485}
486
487func ParseFeatureReference(featureRef string) (featureViewName, featureName string, e error) {
488 parsedFeatureName := strings.Split(featureRef, ":")
489
490 if len(parsedFeatureName) == 0 {
491 e = errors.New("featureReference should be in the format: 'FeatureViewName:FeatureName'")
492 } else if len(parsedFeatureName) == 1 {
493 featureName = parsedFeatureName[0]
494 } else {
495 featureViewName = parsedFeatureName[0]
496 featureName = parsedFeatureName[1]
497 }
498
499 // Handle @version qualifier on feature view name
500 if atIdx := strings.Index(featureViewName, "@"); atIdx >= 0 {
501 suffix := featureViewName[atIdx+1:]
502 if versionTagRegex.MatchString(suffix) {
503 e = fmt.Errorf("versioned feature refs (@%s) are not supported by the Go feature server", suffix)
504 return
505 }
506 if strings.EqualFold(suffix, "latest") {
507 featureViewName = featureViewName[:atIdx]
508 }
509 }
510 return
511}
512
513func entityKeysToProtos(joinKeyValues map[string]*prototypes.RepeatedValue) []*prototypes.EntityKey {
514 keys := make([]string, len(joinKeyValues))

Callers 4

GetEntityTypesMapMethod · 0.92
ValidateFeatureRefsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected