Visitar URL original
fix: Add project filter to apply_data_source and delete_data_source by mailtoboggavarapu-coder · Pull Request #6319 · feast-dev/feast · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: Add project filter to apply_data_source and delete_data_source (f…
…ixes #6206)

apply_data_source and delete_data_source were not filtering by project,
so operations on one project could affect data sources in other projects.

Added project-based filtering to both methods to ensure project isolation.

Signed-off-by: Venkateswarlu Boggavarapu <mailtoboggavarapu@gmail.com>apply_data_source and delete_data_source were not filtering by project,
so operations on one project could affect data sources in other projects.

Added project-based filtering to both methods to ensure project isolation.

Signed-off-by: Venkateswarlu Boggavarapu <mailtoboggavarapu@gmail.com>
  • Loading branch information
mailtoboggavarapu-coder authored Apr 22, 2026
commit 4ec316e88d5b83ac2d26544a6deae17f0e5fa6a9
19 changes: 14 additions & 5 deletions sdk/python/feast/infra/registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ def list_data_sources(
def apply_data_source(
self, data_source: DataSource, project: str, commit: bool = True
):
"""Apply a data source to the registry with project-scoped deduplication.

Filters existing data sources by both name and project (fixes feast-dev/feast#6206),
preserving the original created_timestamp if the source already exists in the
target project.
"""
now = _utc_now()
if not data_source.created_timestamp:
data_source.created_timestamp = now
Expand All @@ -394,7 +400,10 @@ def apply_data_source(
registry = self._prepare_registry_for_changes(project)

for idx, existing_data_source_proto in enumerate(registry.data_sources):
if existing_data_source_proto.name == data_source.name:
if (
existing_data_source_proto.name == data_source.name
and existing_data_source_proto.project == project
):
existing_data_source = DataSource.from_proto(existing_data_source_proto)
# Check if the data source has actually changed
if existing_data_source == data_source:
Expand Down Expand Up @@ -423,7 +432,7 @@ def delete_data_source(self, name: str, project: str, commit: bool = True):
for idx, data_source_proto in enumerate(
self.cached_registry_proto.data_sources
):
if data_source_proto.name == name:
if data_source_proto.name == name and data_source_proto.project == project:
del self.cached_registry_proto.data_sources[idx]
if commit:
self.commit()
Expand Down Expand Up @@ -688,13 +697,13 @@ def apply_feature_view(

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

if record is not None:
# Version exists → pin/revert to that snapshot
# Version exists → pin/revert to that snapshot
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Outdated
# Check that the user hasn't also modified the definition.
# Compare user's FV (with version="latest") against active FV.
self._prepare_registry_for_changes(project)
Expand Down Expand Up @@ -735,7 +744,7 @@ def apply_feature_view(
# Apply the restored FV using the standard path below
feature_view = restored_fv
else:
# Version doesn't exist → forward declaration: create it
# Version doesn't exist → forward declaration: create it
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Outdated
feature_view.current_version_number = pin_version
feature_view_proto = feature_view.to_proto()
feature_view_proto.spec.project = project
Expand Down