@@ -64,13 +64,13 @@ def apply_entity(self, entity: Entity, project: str):
6464 """
6565 entity .is_valid ()
6666 entity_proto = entity .to_proto ()
67- entity_proto .project = project
67+ entity_proto .spec . project = project
6868
6969 def updater (registry_proto : RegistryProto ):
7070 for idx , existing_entity_proto in enumerate (registry_proto .entities ):
7171 if (
7272 existing_entity_proto .spec .name == entity_proto .spec .name
73- and existing_entity_proto .project == project
73+ and existing_entity_proto .spec . project == project
7474 ):
7575 del registry_proto .entities [idx ]
7676 registry_proto .entities .append (entity_proto )
@@ -94,7 +94,7 @@ def list_entities(self, project: str) -> List[Entity]:
9494 registry_proto = self ._registry_store .get_registry ()
9595 entities = []
9696 for entity_proto in registry_proto .entities :
97- if entity_proto .project == project :
97+ if entity_proto .spec . project == project :
9898 entities .append (Entity .from_proto (entity_proto ))
9999 return entities
100100
@@ -112,7 +112,7 @@ def get_entity(self, name: str, project: str) -> Entity:
112112 """
113113 registry_proto = self ._registry_store .get_registry ()
114114 for entity_proto in registry_proto .entities :
115- if entity_proto .spec .name == name and entity_proto .project == project :
115+ if entity_proto .spec .name == name and entity_proto .spec . project == project :
116116 return Entity .from_proto (entity_proto )
117117 raise Exception (f"Entity { name } does not exist in project { project } " )
118118
@@ -126,7 +126,7 @@ def apply_feature_table(self, feature_table: FeatureTable, project: str):
126126 """
127127 feature_table .is_valid ()
128128 feature_table_proto = feature_table .to_proto ()
129- feature_table_proto .project = project
129+ feature_table_proto .spec . project = project
130130
131131 def updater (registry_proto : RegistryProto ):
132132 for idx , existing_feature_table_proto in enumerate (
@@ -135,7 +135,7 @@ def updater(registry_proto: RegistryProto):
135135 if (
136136 existing_feature_table_proto .spec .name
137137 == feature_table_proto .spec .name
138- and existing_feature_table_proto .project == project
138+ and existing_feature_table_proto .spec . project == project
139139 ):
140140 del registry_proto .feature_tables [idx ]
141141 registry_proto .feature_tables .append (feature_table_proto )
@@ -156,7 +156,7 @@ def apply_feature_view(self, feature_view: FeatureView, project: str):
156156 """
157157 feature_view .is_valid ()
158158 feature_view_proto = feature_view .to_proto ()
159- feature_view_proto .project = project
159+ feature_view_proto .spec . project = project
160160
161161 def updater (registry_proto : RegistryProto ):
162162 for idx , existing_feature_view_proto in enumerate (
@@ -165,7 +165,7 @@ def updater(registry_proto: RegistryProto):
165165 if (
166166 existing_feature_view_proto .spec .name
167167 == feature_view_proto .spec .name
168- and existing_feature_view_proto .project == project
168+ and existing_feature_view_proto .spec . project == project
169169 ):
170170 del registry_proto .feature_views [idx ]
171171 registry_proto .feature_views .append (feature_view_proto )
@@ -188,7 +188,7 @@ def list_feature_tables(self, project: str) -> List[FeatureTable]:
188188 registry_proto = self ._registry_store .get_registry ()
189189 feature_tables = []
190190 for feature_table_proto in registry_proto .feature_tables :
191- if feature_table_proto .project == project :
191+ if feature_table_proto .spec . project == project :
192192 feature_tables .append (FeatureTable .from_proto (feature_table_proto ))
193193 return feature_tables
194194
@@ -205,7 +205,7 @@ def list_feature_views(self, project: str) -> List[FeatureView]:
205205 registry_proto = self ._registry_store .get_registry ()
206206 feature_views = []
207207 for feature_view_proto in registry_proto .feature_views :
208- if feature_view_proto .project == project :
208+ if feature_view_proto .spec . project == project :
209209 feature_views .append (FeatureView .from_proto (feature_view_proto ))
210210 return feature_views
211211
@@ -225,7 +225,7 @@ def get_feature_table(self, name: str, project: str) -> FeatureTable:
225225 for feature_table_proto in registry_proto .feature_tables :
226226 if (
227227 feature_table_proto .spec .name == name
228- and feature_table_proto .project == project
228+ and feature_table_proto .spec . project == project
229229 ):
230230 return FeatureTable .from_proto (feature_table_proto )
231231 raise Exception (f"Feature table { name } does not exist in project { project } " )
@@ -246,7 +246,7 @@ def get_feature_view(self, name: str, project: str) -> FeatureView:
246246 for feature_view_proto in registry_proto .feature_views :
247247 if (
248248 feature_view_proto .spec .name == name
249- and feature_view_proto .project == project
249+ and feature_view_proto .spec . project == project
250250 ):
251251 return FeatureView .from_proto (feature_view_proto )
252252 raise Exception (f"Feature view { name } does not exist in project { project } " )
@@ -266,7 +266,7 @@ def updater(registry_proto: RegistryProto):
266266 ):
267267 if (
268268 existing_feature_table_proto .spec .name == name
269- and existing_feature_table_proto .project == project
269+ and existing_feature_table_proto .spec . project == project
270270 ):
271271 del registry_proto .feature_tables [idx ]
272272 return registry_proto
@@ -290,7 +290,7 @@ def updater(registry_proto: RegistryProto):
290290 ):
291291 if (
292292 existing_feature_view_proto .spec .name == name
293- and existing_feature_view_proto .project == project
293+ and existing_feature_view_proto .spec . project == project
294294 ):
295295 del registry_proto .feature_views [idx ]
296296 return registry_proto
0 commit comments