From 856d334faa67fb30bd5e6f2fceb5947d2b874432 Mon Sep 17 00:00:00 2001 From: Abhishek8108 <87538407+Abhishek8108@users.noreply.github.com> Date: Wed, 8 Apr 2026 21:48:44 +0100 Subject: [PATCH] fix: correct project_id scoping in get_user_metadata and delete_project get_user_metadata was filtering only by feature view name, allowing a shared Snowflake registry to return user metadata from a different project's feature view with the same name. Added project_id = '{project}' to the WHERE clause, consistent with apply_user_metadata. delete_project was interpolating a Project object into the SQL string instead of the project name string, which would use __str__ of the object rather than the actual name. Changed to use the `name` parameter directly. Signed-off-by: Abhishek8108 <87538407+Abhishek8108@users.noreply.github.com> --- sdk/python/feast/infra/registry/snowflake.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/registry/snowflake.py b/sdk/python/feast/infra/registry/snowflake.py index 68bf376e650..0826923f7f8 100644 --- a/sdk/python/feast/infra/registry/snowflake.py +++ b/sdk/python/feast/infra/registry/snowflake.py @@ -1116,7 +1116,8 @@ def get_user_metadata( FROM {self.registry_path}."{fv_table_str}" WHERE - {fv_column_name}_name = '{feature_view.name}' + project_id = '{project}' + AND {fv_column_name}_name = '{feature_view.name}' LIMIT 1 """ df = execute_snowflake_statement(conn, query).fetch_pandas_all() @@ -1322,7 +1323,7 @@ def delete_project( query = f""" DELETE FROM {self.registry_path}."{table}" WHERE - project_id = '{project}' + project_id = '{name}' """ execute_snowflake_statement(conn, query) return