GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Add project filter to apply_data_source and delete_data_source (closes #6206) by mailtoboggavarapu-coder · Pull Request #6322 · feast-dev/feast

fix: Add project filter to apply_data_source and delete_data_source (closes #6206) #6322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
ntkathole merged 4 commits into feast-dev:master from mailtoboggavarapu-coder:patch-1
May 1, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix: Add project filter to apply_data_source and delete_data_source (closes #6206) #6322

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
dd8874a
fix: Add project filter to apply_data_source and delete_data_source (…
mailtoboggavarapu-coder Apr 23, 2026
b7fa291
test: add cross-project isolation tests for apply/delete_data_source
mailtoboggavarapu-coder Apr 23, 2026
c62c5f1
style: remove extra blank line between decorator and function
mailtoboggavarapu-coder Apr 26, 2026
9817a6e
fix(tests): scope cross-project isolation tests to local_registry only
mailtoboggavarapu-coder Apr 30, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

13 changes: 11 additions & 2 deletions 13 sdk/python/feast/infra/registry/registry.py
Show comments
View file
Open in desktop
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
105 changes: 105 additions & 0 deletions 105 sdk/python/tests/integration/registration/test_universal_registry.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,111 @@ def test_apply_data_source_with_timestamps(test_registry):
test_registry.teardown()


@pytest.mark.integration
@pytest.mark.parametrize(
"test_registry",
[lazy_fixture("local_registry")],
)
def test_apply_data_source_cross_project_isolation(test_registry):
"""Test that apply_data_source uses project-scoped filtering.

Regression test for https://github.com/feast-dev/feast/issues/6206:
applying a data source to one project must not overwrite the data source
with the same name in a different project.

See: feast-dev/feast#6298
"""
project_a = "project_a"
project_b = "project_b"

source_a = FileSource(
name="shared_source_name",
file_format=ParquetFormat(),
path="file://feast/project_a.parquet",
timestamp_field="ts_col",
)
source_b = FileSource(
name="shared_source_name",
file_format=ParquetFormat(),
path="file://feast/project_b.parquet",
timestamp_field="ts_col",
)

test_registry.apply_data_source(source_a, project_a, commit=True)
test_registry.apply_data_source(source_b, project_b, commit=True)

# Each project should have exactly its own source
sources_a = test_registry.list_data_sources(project_a)
sources_b = test_registry.list_data_sources(project_b)
assert len(sources_a) == 1
assert len(sources_b) == 1

# Paths must be project-specific — not overwritten cross-project
assert sources_a[0].path == "file://feast/project_a.parquet"
assert sources_b[0].path == "file://feast/project_b.parquet"

# Re-apply source_b with updated path: must not bleed into project_a
source_b_updated = FileSource(
name="shared_source_name",
file_format=ParquetFormat(),
path="file://feast/project_b_v2.parquet",
timestamp_field="ts_col",
)
test_registry.apply_data_source(source_b_updated, project_b, commit=True)

sources_a_after = test_registry.list_data_sources(project_a)
assert len(sources_a_after) == 1
assert sources_a_after[0].path == "file://feast/project_a.parquet", (
"apply_data_source for project_b must not overwrite project_a's source"
)

test_registry.teardown()


@pytest.mark.integration
@pytest.mark.parametrize(
"test_registry",
[lazy_fixture("local_registry")],
)
def test_delete_data_source_project_scoped(test_registry):
"""Test that delete_data_source only removes the source from the given project.

Regression test for https://github.com/feast-dev/feast/issues/6206:
deleting a data source from one project must not delete the data source
with the same name from another project.
"""
project_a = "project_a"
project_b = "project_b"

source_a = FileSource(
name="shared_source_name",
file_format=ParquetFormat(),
path="file://feast/project_a.parquet",
timestamp_field="ts_col",
)
source_b = FileSource(
name="shared_source_name",
file_format=ParquetFormat(),
path="file://feast/project_b.parquet",
timestamp_field="ts_col",
)

test_registry.apply_data_source(source_a, project_a, commit=True)
test_registry.apply_data_source(source_b, project_b, commit=True)

# Delete the source from project_a only
test_registry.delete_data_source("shared_source_name", project_a, commit=True)

# project_a should have no sources; project_b should be unaffected
sources_a = test_registry.list_data_sources(project_a)
sources_b = test_registry.list_data_sources(project_b)
assert len(sources_a) == 0, "Source should be deleted from project_a"
assert len(sources_b) == 1, "Source in project_b must not be deleted"
assert sources_b[0].path == "file://feast/project_b.parquet"

test_registry.teardown()


@pytest.mark.integration
@pytest.mark.parametrize(
"test_registry",
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.