diff --git a/sdk/python/feast/feature_view.py b/sdk/python/feast/feature_view.py index 9f07e192b1..19ebc3a57f 100644 --- a/sdk/python/feast/feature_view.py +++ b/sdk/python/feast/feature_view.py @@ -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, diff --git a/sdk/python/feast/stream_feature_view.py b/sdk/python/feast/stream_feature_view.py index a02508308f..ca8da44738 100644 --- a/sdk/python/feast/stream_feature_view.py +++ b/sdk/python/feast/stream_feature_view.py @@ -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] = "", @@ -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, diff --git a/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py b/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py index 38cf104d24..cd61822e1c 100644 --- a/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py +++ b/sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py @@ -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]) diff --git a/sdk/python/tests/unit/diff/test_registry_diff.py b/sdk/python/tests/unit/diff/test_registry_diff.py index 9c4be2af37..61f4f77702 100644 --- a/sdk/python/tests/unit/diff/test_registry_diff.py +++ b/sdk/python/tests/unit/diff/test_registry_diff.py @@ -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( @@ -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"}, )