feast-dev / feast-dev/feast

Feature View's ttl is misleading

Open
#4,133 14 comments 0 reactions 0 assignees View on GitHub
kind/feature
Dominant language
Python
Stars
7.3k
Forks
1.4k
Avg merge
1d 21h
Merged PRs (30d)
15

Description

**Is your feature request related to a problem? Please describe.**
The field name `ttl` used in `FeatureView` is misleading.
Time to Live (TTL) is a well known term that defines a mechanism to automatically expire database records. In Redis, for example, the command `EXPIRE` defines a time to live for a given key.

When I used that FeatureView.ttl configuration for the first time, I expected to set some expiration time (or TTL) for keys written into online stores. The documentation states something like this [here](https://github.com/breno-costa/feast/blob/master/sdk/python/feast/feature_view.py#L63-L65).

> The amount of time this group of features lives. A ttl of 0 indicates that this group of features lives forever.

However FeatureView's TTL is not used in that way. It's used to define `start_date` to extract data from offline store during materialization step [here](https://github.com/breno-costa/feast/blob/master/sdk/python/feast/feature_store.py#L1246). The actual key ttl configuration used to expire entities is `key_ttl_seconds` at online store level [here](https://github.com/breno-costa/feast/blob/master/sdk/python/feast/infra/online_stores/redis.py#L77).

I had to explain this sometimes to different people because of this misunderstanding. I think this is also kind of mentioned [here](https://github.com/feast-dev/feast/issues/3435) and [here](https://github.com/feast-dev/feast/issues/3596).

**Describe the solution you'd like**
My suggestion is renaming this field to something like `materialization_lookback_interval`, `lookback_interval` or `lookback_delta` since this is the actual meaning of this configuration as far as I understand. Also update docs accordingly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.