Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add default ttl for feature views #3037

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
source: DataSource,
schema: Optional[List[Field]] = None,
entities: List[Entity] = None,
ttl: timedelta = None,
ttl: timedelta = timedelta(days=0),
online: bool = True,
description: str = "",
tags: Optional[Dict[str, str]] = None,
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/stream_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
name: str,
source: DataSource,
entities: Optional[Union[List[Entity], List[str]]] = None,
ttl: Optional[timedelta] = None,
ttl: timedelta = timedelta(days=0),
tags: Optional[Dict[str, str]] = None,
online: Optional[bool] = True,
description: Optional[str] = "",
Expand Down Expand Up @@ -119,7 +119,7 @@ def __init__(
super().__init__(
name=name,
entities=entities,
ttl=ttl or timedelta(days=0),
ttl=ttl,
tags=tags,
online=online,
description=description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ def test_historical_features_from_bigquery_sources_containing_backfills(environm
entities=[driver],
schema=[Field(name="avg_daily_trips", dtype=Int32)],
source=driver_stats_data_source,
ttl=None,
)

store.apply([driver, driver_fv])
Expand Down
7 changes: 0 additions & 7 deletions sdk/python/tests/unit/diff/test_registry_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,28 @@ def test_tag_objects_for_keep_delete_update_add(simple_dataset_1):
name="to_delete",
entities=[entity],
source=file_source,
ttl=None,
)
unchanged_fv = FeatureView(
name="fv1",
entities=[entity],
source=file_source,
ttl=None,
)
pre_changed = FeatureView(
name="fv2",
entities=[entity],
source=file_source,
ttl=None,
tags={"when": "before"},
)
post_changed = FeatureView(
name="fv2",
entities=[entity],
source=file_source,
ttl=None,
tags={"when": "after"},
)
to_add = FeatureView(
name="to_add",
entities=[entity],
source=file_source,
ttl=None,
)

keep, delete, update, add = tag_objects_for_keep_delete_update_add(
Expand Down Expand Up @@ -68,14 +63,12 @@ def test_diff_registry_objects_feature_views(simple_dataset_1):
name="fv2",
entities=[entity],
source=file_source,
ttl=None,
tags={"when": "before"},
)
post_changed = FeatureView(
name="fv2",
entities=[entity],
source=file_source,
ttl=None,
tags={"when": "after"},
)

Expand Down