@@ -898,6 +898,108 @@ def test_apply_data_source_with_timestamps(test_registry):
898898
899899 test_registry .teardown ()
900900
901+ @pytest .mark .integration
902+ @pytest .mark .parametrize (
903+ "test_registry" ,
904+ all_fixtures ,
905+ )
906+ def test_apply_data_source_cross_project_isolation (test_registry ):
907+ """Test that apply_data_source uses project-scoped filtering.
908+
909+ Regression test for https://github.com/feast-dev/feast/issues/6206:
910+ applying a data source to one project must not overwrite the data source
911+ with the same name in a different project.
912+ """
913+ project_a = "project_a"
914+ project_b = "project_b"
915+
916+ source_a = FileSource (
917+ name = "shared_source_name" ,
918+ file_format = ParquetFormat (),
919+ path = "file://feast/project_a.parquet" ,
920+ timestamp_field = "ts_col" ,
921+ )
922+ source_b = FileSource (
923+ name = "shared_source_name" ,
924+ file_format = ParquetFormat (),
925+ path = "file://feast/project_b.parquet" ,
926+ timestamp_field = "ts_col" ,
927+ )
928+
929+ test_registry .apply_data_source (source_a , project_a , commit = True )
930+ test_registry .apply_data_source (source_b , project_b , commit = True )
931+
932+ # Each project should have exactly its own source
933+ sources_a = test_registry .list_data_sources (project_a )
934+ sources_b = test_registry .list_data_sources (project_b )
935+ assert len (sources_a ) == 1
936+ assert len (sources_b ) == 1
937+
938+ # Paths must be project-specific — not overwritten cross-project
939+ assert sources_a [0 ].path == "file://feast/project_a.parquet"
940+ assert sources_b [0 ].path == "file://feast/project_b.parquet"
941+
942+ # Re-apply source_b with updated path: must not bleed into project_a
943+ source_b_updated = FileSource (
944+ name = "shared_source_name" ,
945+ file_format = ParquetFormat (),
946+ path = "file://feast/project_b_v2.parquet" ,
947+ timestamp_field = "ts_col" ,
948+ )
949+ test_registry .apply_data_source (source_b_updated , project_b , commit = True )
950+
951+ sources_a_after = test_registry .list_data_sources (project_a )
952+ assert len (sources_a_after ) == 1
953+ assert sources_a_after [0 ].path == "file://feast/project_a.parquet" , (
954+ "apply_data_source for project_b must not overwrite project_a's source"
955+ )
956+
957+ test_registry .teardown ()
958+
959+
960+ @pytest .mark .integration
961+ @pytest .mark .parametrize (
962+ "test_registry" ,
963+ all_fixtures ,
964+ )
965+ def test_delete_data_source_project_scoped (test_registry ):
966+ """Test that delete_data_source only removes the source from the given project.
967+
968+ Regression test for https://github.com/feast-dev/feast/issues/6206:
969+ deleting a data source from one project must not delete the data source
970+ with the same name from another project.
971+ """
972+ project_a = "project_a"
973+ project_b = "project_b"
974+
975+ source_a = FileSource (
976+ name = "shared_source_name" ,
977+ file_format = ParquetFormat (),
978+ path = "file://feast/project_a.parquet" ,
979+ timestamp_field = "ts_col" ,
980+ )
981+ source_b = FileSource (
982+ name = "shared_source_name" ,
983+ file_format = ParquetFormat (),
984+ path = "file://feast/project_b.parquet" ,
985+ timestamp_field = "ts_col" ,
986+ )
987+
988+ test_registry .apply_data_source (source_a , project_a , commit = True )
989+ test_registry .apply_data_source (source_b , project_b , commit = True )
990+
991+ # Delete the source from project_a only
992+ test_registry .delete_data_source ("shared_source_name" , project_a , commit = True )
993+
994+ # project_a should have no sources; project_b should be unaffected
995+ sources_a = test_registry .list_data_sources (project_a )
996+ sources_b = test_registry .list_data_sources (project_b )
997+ assert len (sources_a ) == 0 , "Source should be deleted from project_a"
998+ assert len (sources_b ) == 1 , "Source in project_b must not be deleted"
999+ assert sources_b [0 ].path == "file://feast/project_b.parquet"
1000+
1001+ test_registry .teardown ()
1002+
9011003
9021004@pytest .mark .integration
9031005@pytest .mark .parametrize (
0 commit comments