Title: `FeatureStore.materialize_incremental()` does not initially materialize data for `FeatureView` with `ttl=0` · Issue #2651 · feast-dev/feast · GitHub
Open Graph Title: `FeatureStore.materialize_incremental()` does not initially materialize data for `FeatureView` with `ttl=0` · Issue #2651 · feast-dev/feast
X Title: `FeatureStore.materialize_incremental()` does not initially materialize data for `FeatureView` with `ttl=0` · Issue #2651 · feast-dev/feast
Description: Expected Behavior When executing FeatureStore.materialize_incremental() on a FeatureView that has a ttl=0 and has never yet been materialized, I would expect all historical data to be materialized since a ttl=0 indicates that features li...
Open Graph Description: Expected Behavior When executing FeatureStore.materialize_incremental() on a FeatureView that has a ttl=0 and has never yet been materialized, I would expect all historical data to be materialized ...
X Description: Expected Behavior When executing FeatureStore.materialize_incremental() on a FeatureView that has a ttl=0 and has never yet been materialized, I would expect all historical data to be materialized ...
Opengraph URL: https://github.com/feast-dev/feast/issues/2651
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`FeatureStore.materialize_incremental()` does not initially materialize data for `FeatureView` with `ttl=0`","articleBody":"## Expected Behavior \r\nWhen executing `FeatureStore.materialize_incremental()` on a `FeatureView` that has a `ttl=0` and has never yet been materialized, I would expect all historical data to be materialized since a `ttl=0` indicates that features live forever according to the [docs](https://rtd.feast.dev/en/master/index.html#feast.feature_view.FeatureView.ttl).\r\n\r\nFor an instance of `FeatureView` that has not explicitly defined `ttl`, it currently defaults to `timedelta(days=0)`, which hints that this is indeed an expected value for `ttl`.\r\n\r\n## Current Behavior\r\nCurrently, the `start_date` for the materialization defaults to `datetime.utcnow() - ttl` if the feature view has not yet been materialized (i.e. `FeatureView.most_recent_end_time is None`). This means that `start_date = datetime.utcnow() - 0s`, thus `start_date = datetime.utcnow()`, resulting in no data being materialized.\r\n\r\n[feast/sdk/python/feast/feature_store.py](https://github.com/feast-dev/feast/blob/5b4b07f999eb38542eb5518cf0db54a98baeeb40/sdk/python/feast/feature_store.py#L1073)\r\n```python\r\n def materialize_incremental(\r\n self, end_date: datetime, feature_views: Optional[List[str]] = None,\r\n ) -\u003e None:\r\n ...\r\n for feature_view in feature_views_to_materialize:\r\n start_date = feature_view.most_recent_end_time\r\n if start_date is None:\r\n if feature_view.ttl is None:\r\n raise Exception(\r\n f\"No start time found for feature view {feature_view.name}. materialize_incremental() requires\"\r\n f\" either a ttl to be set or for materialize() to have been run at least once.\"\r\n )\r\n \u003e\u003e\u003e start_date = datetime.utcnow() - feature_view.ttl \u003c\u003c\u003c\r\n ...\r\n\r\n```\r\n\r\n## Steps to reproduce\r\n\r\n```python\r\nfrom feast import FeatureView, FeatureStore\r\nfrom datetime import datetime \r\n\r\nmy_feature_view = FeatureView(\r\n name=\"my_feature_view\",\r\n entities=[\"my_entity\"],\r\n schema=[\r\n Field(name=\"my_feature\", dtype=types.Bool)\r\n ],\r\n # ttl=timedelta(seconds=0) ; if not defined, TTL defaults to 0s\r\n source=sources.my_source\r\n)\r\n\r\nfs = FeatureStore(\".\")\r\nfs.materialize_incremental(end_date=datetime.utcnow(), views=[\"my_feature_view\"])\r\n```\r\n\r\n### Specifications\r\n\r\n- Version: 0.20.2\r\n- Platform: macOS\r\n- Subsystem:\r\n\r\n## Possible Solution\r\n[feast/sdk/python/feast/feature_store.py](https://github.com/feast-dev/feast/blob/5b4b07f999eb38542eb5518cf0db54a98baeeb40/sdk/python/feast/feature_store.py#L1073)\r\n```python\r\n def materialize_incremental(\r\n self, end_date: datetime, feature_views: Optional[List[str]] = None,\r\n ) -\u003e None:\r\n ...\r\n for feature_view in feature_views_to_materialize:\r\n start_date = feature_view.most_recent_end_time\r\n if start_date is None:\r\n if feature_view.ttl is None:\r\n raise Exception(\r\n f\"No start time found for feature view {feature_view.name}. materialize_incremental() requires\"\r\n f\" either a ttl to be set or for materialize() to have been run at least once.\"\r\n )\r\n start_date = datetime.utcnow() - feature_view.ttl\r\n\r\n if feature_view.ttl == timedelta(days=0):\r\n # what is the lower boundary for \"forever\" (as defined in the docs for ttl=0)?\r\n # the smallest UNIX epoch timestamp could be a good candidate\r\n start_date = datetime(1970, 1, 1)\r\n ...\r\n```\r\n","author":{"url":"https://github.com/chasleslr","@type":"Person","name":"chasleslr"},"datePublished":"2022-05-09T15:43:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2651/feast/issues/2651"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a942645a-ebbf-49a6-06b0-577bc880dc67 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE90:1EA772:F1ED64:15848B1:6978CFA4 |
| html-safe-nonce | 6b7408e7e93396af75d2addba443edfe589a25bf46859819336d9e7d857b0cf0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTkwOjFFQTc3MjpGMUVENjQ6MTU4NDhCMTo2OTc4Q0ZBNCIsInZpc2l0b3JfaWQiOiIxODAzNjgxMzgzMjY0NjA0MDY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ba1d8e0d300aba7b45bbbfb1b1fcd630db7dea79cd0e004a449b233cc2110dd3 |
| hovercard-subject-tag | issue:1229919069 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/2651/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d6f9485c7b55f23e74af3caebdaddec58e74799d05e4cf99fb243a654515f28/feast-dev/feast/issues/2651 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d6f9485c7b55f23e74af3caebdaddec58e74799d05e4cf99fb243a654515f28/feast-dev/feast/issues/2651 |
| og:image:alt | Expected Behavior When executing FeatureStore.materialize_incremental() on a FeatureView that has a ttl=0 and has never yet been materialized, I would expect all historical data to be materialized ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chasleslr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eaed570eead52a9920afef75dc3eb6d826fdc5ef |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width