Skip to content

Commit 0c469a7

Browse files
Abhishek8108ntkathole
authored andcommitted
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>
1 parent c833f1a commit 0c469a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdk/python/feast/infra/registry/snowflake.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,8 @@ def get_user_metadata(
11161116
FROM
11171117
{self.registry_path}."{fv_table_str}"
11181118
WHERE
1119-
{fv_column_name}_name = '{feature_view.name}'
1119+
project_id = '{project}'
1120+
AND {fv_column_name}_name = '{feature_view.name}'
11201121
LIMIT 1
11211122
"""
11221123
df = execute_snowflake_statement(conn, query).fetch_pandas_all()
@@ -1322,7 +1323,7 @@ def delete_project(
13221323
query = f"""
13231324
DELETE FROM {self.registry_path}."{table}"
13241325
WHERE
1325-
project_id = '{project}'
1326+
project_id = '{name}'
13261327
"""
13271328
execute_snowflake_statement(conn, query)
13281329
return

0 commit comments

Comments
 (0)