fix: add project_id filter to SnowflakeRegistry UPDATE path#6243
Open
Abhishek8108 wants to merge 1 commit intofeast-dev:masterfrom
Open
fix: add project_id filter to SnowflakeRegistry UPDATE path#6243Abhishek8108 wants to merge 1 commit intofeast-dev:masterfrom
Abhishek8108 wants to merge 1 commit intofeast-dev:masterfrom
Conversation
_apply_object had a missing project_id clause in the UPDATE branch's WHERE condition. In a shared Snowflake registry, this allowed a feast apply in one project to silently overwrite a same-named object belonging to a different project. The SELECT path already scoped correctly by project_id. The DELETE path (_delete_object) also scoped correctly. This commit brings the UPDATE path in line with both. Fixes feast-dev#6208 Signed-off-by: Abhishek8108 <[email protected]>
d1458cf to
7a9cf1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #6208.
SnowflakeRegistry._apply_objecthad a missingproject_idclause in the UPDATE branch's WHERE condition. In a shared Snowflake registry, this allowed afeast applyin one project to silently overwrite a same-named object belonging to a different project.Root cause: The helper has two SQL branches:
WHERE project_id = '{project}' AND {id_field} = '{name}'project_id:WHERE {id_field} = '{name}'The fix brings the UPDATE path in line with the SELECT and DELETE paths, which already scoped by
project_idcorrectly.Impact: Affects all resource types routed through
_apply_object— entities, data sources, feature views, feature services, saved datasets, validation references, permissions, and infrastructure objects.Changes
sdk/python/feast/infra/registry/snowflake.py— addproject_id = '{project}' ANDto the UPDATE WHERE clause (one line)sdk/python/tests/unit/infra/registry/test_snowflake_registry.py— new regression test; mocks the Snowflake connection, drives_apply_objectinto the UPDATE path, and assertsproject_idappears in the WHERE clauseTest plan
pytest sdk/python/tests/unit/infra/registry/test_snowflake_registry.py -vpytest sdk/python/tests/unit/infra/registry/ -vWHERE project_id = '{project}' AND {id_field} = '{name}'