Skip to content

Commit 945576e

Browse files
fix: add project filter to apply_data_source and delete_data_source
Fixes #6206 The apply_data_source method was matching data sources by name only, without filtering by project. In a shared registry scenario where multiple projects have data sources with the same name, this caused cross-project overwriting. Also fix delete_data_source to use the same project-scoped filter, ensuring consistency across all registry mutation methods. Additionally fix Unicode mojibake in comments (em dashes were double-encoded as Latin-1 codepoints instead of UTF-8). Signed-off-by: Venkateswarlu Boggavarapu <mailtoboggavarapu@gmail.com>
1 parent 7243af3 commit 945576e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ def delete_data_source(self, name: str, project: str, commit: bool = True):
426426
for idx, data_source_proto in enumerate(
427427
self.cached_registry_proto.data_sources
428428
):
429-
if data_source_proto.name == name:
429+
if (
430+
data_source_proto.name == name
431+
and data_source_proto.project == project
432+
):
430433
del self.cached_registry_proto.data_sources[idx]
431434
if commit:
432435
self.commit()
@@ -691,13 +694,13 @@ def apply_feature_view(
691694

692695
if not is_latest:
693696
# Explicit version: check if it exists (pin/revert) or not (forward declaration).
694-
# Note: The file registry is last-write-wins for true concurrent races —
697+
# Note: The file registry is last-write-wins for true concurrent races —
695698
# this is a pre-existing limitation for all file registry operations.
696699
# For multi-client environments, use the SQL registry.
697700
record = self._get_version_record(feature_view.name, project, pin_version)
698701

699702
if record is not None:
700-
# Version exists → pin/revert to that snapshot
703+
# Version exists → pin/revert to that snapshot
701704
# Check that the user hasn't also modified the definition.
702705
# Compare user's FV (with version="latest") against active FV.
703706
self._prepare_registry_for_changes(project)
@@ -738,7 +741,7 @@ def apply_feature_view(
738741
# Apply the restored FV using the standard path below
739742
feature_view = restored_fv
740743
else:
741-
# Version doesn't exist → forward declaration: create it
744+
# Version doesn't exist → forward declaration: create it
742745
feature_view.current_version_number = pin_version
743746
feature_view_proto = feature_view.to_proto()
744747
feature_view_proto.spec.project = project

0 commit comments

Comments
 (0)