33import threading
44import warnings
55from abc import abstractmethod
6- from datetime import timedelta
6+ from datetime import datetime , timedelta
77from threading import Lock
88from typing import Any , Dict , List , Optional
99
@@ -122,7 +122,11 @@ def get_any_feature_view(
122122
123123 @abstractmethod
124124 def _list_all_feature_views (
125- self , project : str , tags : Optional [dict [str , str ]], ** kwargs : Any
125+ self ,
126+ project : str ,
127+ tags : Optional [dict [str , str ]],
128+ updated_since : Optional [datetime ] = None ,
129+ ** kwargs : Any ,
126130 ) -> List [BaseFeatureView ]:
127131 pass
128132
@@ -132,13 +136,31 @@ def list_all_feature_views(
132136 allow_cache : bool = False ,
133137 tags : Optional [dict [str , str ]] = None ,
134138 skip_udf : bool = False ,
139+ updated_since : Optional [datetime ] = None ,
135140 ) -> List [BaseFeatureView ]:
136141 if allow_cache :
137142 self ._refresh_cached_registry_if_necessary ()
138- return proto_registry_utils .list_all_feature_views (
143+ feature_views = proto_registry_utils .list_all_feature_views (
139144 self .cached_registry_proto , project , tags , skip_udf = skip_udf
140145 )
141- return self ._list_all_feature_views (project , tags , skip_udf = skip_udf )
146+ if updated_since is not None :
147+ # last_updated_timestamp from proto is offset-naive UTC; normalise for comparison
148+ cutoff = (
149+ updated_since .replace (tzinfo = None )
150+ if updated_since .tzinfo
151+ else updated_since
152+ )
153+ feature_views = [
154+ fv
155+ for fv in feature_views
156+ if fv .last_updated_timestamp is not None
157+ and fv .last_updated_timestamp >= cutoff
158+ ]
159+ else :
160+ feature_views = self ._list_all_feature_views (
161+ project , tags , updated_since = updated_since , skip_udf = skip_udf
162+ )
163+ return feature_views
142164
143165 @abstractmethod
144166 def _get_feature_view (self , name : str , project : str ) -> FeatureView :
0 commit comments