@@ -231,6 +231,12 @@ def apply_entity(self, entity: Entity, project: str, commit: bool = True):
231231 commit: Whether the change should be persisted immediately
232232 """
233233 entity .is_valid ()
234+
235+ now = datetime .utcnow ()
236+ if not entity .created_timestamp :
237+ entity ._created_timestamp = now
238+ entity ._last_updated_timestamp = now
239+
234240 entity_proto = entity .to_proto ()
235241 entity_proto .spec .project = project
236242 self ._prepare_registry_for_changes ()
@@ -278,6 +284,11 @@ def apply_feature_service(
278284 feature_service: A feature service that will be registered
279285 project: Feast project that this entity belongs to
280286 """
287+ now = datetime .utcnow ()
288+ if not feature_service .created_timestamp :
289+ feature_service .created_timestamp = now
290+ feature_service .last_updated_timestamp = now
291+
281292 feature_service_proto = feature_service .to_proto ()
282293 feature_service_proto .spec .project = project
283294
@@ -373,8 +384,12 @@ def apply_feature_view(
373384 commit: Whether the change should be persisted immediately
374385 """
375386 feature_view .ensure_valid ()
387+
388+ now = datetime .utcnow ()
376389 if not feature_view .created_timestamp :
377- feature_view .created_timestamp = datetime .utcnow ()
390+ feature_view .created_timestamp = now
391+ feature_view .last_updated_timestamp = now
392+
378393 feature_view_proto = feature_view .to_proto ()
379394 feature_view_proto .spec .project = project
380395 self ._prepare_registry_for_changes ()
@@ -498,6 +513,7 @@ def apply_materialization(
498513 existing_feature_view .materialization_intervals .append (
499514 (start_date , end_date )
500515 )
516+ existing_feature_view .last_updated_timestamp = datetime .utcnow ()
501517 feature_view_proto = existing_feature_view .to_proto ()
502518 feature_view_proto .spec .project = project
503519 del self .cached_registry_proto .feature_views [idx ]
@@ -686,6 +702,11 @@ def apply_saved_dataset(
686702 project: Feast project that this dataset belongs to
687703 commit: Whether the change should be persisted immediately
688704 """
705+ now = datetime .utcnow ()
706+ if not saved_dataset .created_timestamp :
707+ saved_dataset .created_timestamp = now
708+ saved_dataset .last_updated_timestamp = now
709+
689710 saved_dataset_proto = saved_dataset .to_proto ()
690711 saved_dataset_proto .spec .project = project
691712 self ._prepare_registry_for_changes ()
0 commit comments