From bd2c94c5b129b8c35faa56605849bae6a91d12ea Mon Sep 17 00:00:00 2001 From: William Horton Date: Mon, 19 Sep 2022 10:51:42 -0400 Subject: [PATCH] Fix handling of TTL in Go server According to the FeatureView docstring, 'A ttl of 0 indicates that this group of features lives forever.' However, the Go feature server doesn't currently respect this, returning OUTSIDE_MAX_AGE for FeatureViews that have a TTL of 0. This fixes that issue by always returning false for checkOutsideTtl if the TTL is 0. Signed-off-by: William Horton --- go/internal/feast/onlineserving/serving.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/internal/feast/onlineserving/serving.go b/go/internal/feast/onlineserving/serving.go index 131cc6d1f1..dc7124fc8b 100644 --- a/go/internal/feast/onlineserving/serving.go +++ b/go/internal/feast/onlineserving/serving.go @@ -633,6 +633,9 @@ func getUniqueEntityRows(joinKeysProto []*prototypes.EntityKey) ([]*prototypes.E } func checkOutsideTtl(featureTimestamp *timestamppb.Timestamp, currentTimestamp *timestamppb.Timestamp, ttl *durationpb.Duration) bool { + if ttl.Seconds == 0 { + return false + } return currentTimestamp.GetSeconds()-featureTimestamp.GetSeconds() > ttl.Seconds }