From 30f7bbad96651a19c698663582eafa43779d313e Mon Sep 17 00:00:00 2001 From: corentinmarek Date: Fri, 7 Jan 2022 15:28:25 +0000 Subject: [PATCH] Add on demand feature views deletion (#2203) Signed-off-by: corentinmarek --- sdk/python/feast/registry.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk/python/feast/registry.py b/sdk/python/feast/registry.py index e57ecdee2c..d5c4c08048 100644 --- a/sdk/python/feast/registry.py +++ b/sdk/python/feast/registry.py @@ -667,6 +667,18 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True): self.commit() return + for idx, existing_on_demand_feature_view_proto in enumerate( + self.cached_registry_proto.on_demand_feature_views + ): + if ( + existing_on_demand_feature_view_proto.spec.name == name + and existing_on_demand_feature_view_proto.spec.project == project + ): + del self.cached_registry_proto.on_demand_feature_views[idx] + if commit: + self.commit() + return + raise FeatureViewNotFoundException(name, project) def delete_entity(self, name: str, project: str, commit: bool = True):