@@ -349,7 +349,10 @@ def _get_stream_feature_view(self, name: str, project: str):
349349 )
350350
351351 def _list_stream_feature_views (
352- self , project : str , tags : Optional [dict [str , str ]]
352+ self ,
353+ project : str ,
354+ tags : Optional [dict [str , str ]],
355+ updated_since : Optional [datetime ] = None ,
353356 ) -> List [StreamFeatureView ]:
354357 return self ._list_objects (
355358 stream_feature_views ,
@@ -358,6 +361,7 @@ def _list_stream_feature_views(
358361 StreamFeatureView ,
359362 "feature_view_proto" ,
360363 tags = tags ,
364+ updated_since = updated_since ,
361365 )
362366
363367 def apply_entity (self , entity : Entity , project : str , commit : bool = True ):
@@ -419,20 +423,23 @@ def _get_any_feature_view(self, name: str, project: str) -> BaseFeatureView:
419423 return fv
420424
421425 def _list_all_feature_views (
422- self , project : str , tags : Optional [dict [str , str ]]
426+ self ,
427+ project : str ,
428+ tags : Optional [dict [str , str ]],
429+ updated_since : Optional [datetime ] = None ,
423430 ) -> List [BaseFeatureView ]:
424431 return (
425432 cast (
426433 list [BaseFeatureView ],
427- self ._list_feature_views (project = project , tags = tags ),
434+ self ._list_feature_views (project = project , tags = tags , updated_since = updated_since ),
428435 )
429436 + cast (
430437 list [BaseFeatureView ],
431- self ._list_stream_feature_views (project = project , tags = tags ),
438+ self ._list_stream_feature_views (project = project , tags = tags , updated_since = updated_since ),
432439 )
433440 + cast (
434441 list [BaseFeatureView ],
435- self ._list_on_demand_feature_views (project = project , tags = tags ),
442+ self ._list_on_demand_feature_views (project = project , tags = tags , updated_since = updated_since ),
436443 )
437444 )
438445
@@ -619,7 +626,10 @@ def _list_feature_services(
619626 )
620627
621628 def _list_feature_views (
622- self , project : str , tags : Optional [dict [str , str ]]
629+ self ,
630+ project : str ,
631+ tags : Optional [dict [str , str ]],
632+ updated_since : Optional [datetime ] = None ,
623633 ) -> List [FeatureView ]:
624634 return self ._list_objects (
625635 feature_views ,
@@ -628,6 +638,7 @@ def _list_feature_views(
628638 FeatureView ,
629639 "feature_view_proto" ,
630640 tags = tags ,
641+ updated_since = updated_since ,
631642 )
632643
633644 def _list_saved_datasets (
@@ -643,7 +654,10 @@ def _list_saved_datasets(
643654 )
644655
645656 def _list_on_demand_feature_views (
646- self , project : str , tags : Optional [dict [str , str ]]
657+ self ,
658+ project : str ,
659+ tags : Optional [dict [str , str ]],
660+ updated_since : Optional [datetime ] = None ,
647661 ) -> List [OnDemandFeatureView ]:
648662 return self ._list_objects (
649663 on_demand_feature_views ,
@@ -652,6 +666,7 @@ def _list_on_demand_feature_views(
652666 OnDemandFeatureView ,
653667 "feature_view_proto" ,
654668 tags = tags ,
669+ updated_since = updated_since ,
655670 )
656671
657672 def _list_project_metadata (self , project : str ) -> List [ProjectMetadata ]:
@@ -1097,9 +1112,15 @@ def _list_objects(
10971112 python_class : Any ,
10981113 proto_field_name : str ,
10991114 tags : Optional [dict [str , str ]] = None ,
1115+ updated_since : Optional [datetime ] = None ,
11001116 ):
11011117 with self .read_engine .begin () as conn :
11021118 stmt = select (table ).where (table .c .project_id == project )
1119+ if updated_since is not None :
1120+ stmt = stmt .where (
1121+ table .c .last_updated_timestamp
1122+ >= int (updated_since .timestamp ())
1123+ )
11031124 rows = conn .execute (stmt ).all ()
11041125 if rows :
11051126 objects = []
0 commit comments