Skip to content

Commit e4917ca

Browse files
authored
fix: The ignore_paths not taking effect duration feast apply (#5353)
fix: ignore_paths not taking effect Signed-off-by: joeyutong <[email protected]>
1 parent d5d6766 commit e4917ca

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

sdk/python/feast/repo_operations.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def read_feastignore(repo_root: Path) -> List[str]:
6969
def get_ignore_files(repo_root: Path, ignore_paths: List[str]) -> Set[Path]:
7070
"""Get all ignore files that match any of the user-defined ignore paths"""
7171
ignore_files = set()
72-
for ignore_path in ignore_paths:
72+
for ignore_path in set(ignore_paths):
7373
# ignore_path may contains matchers (* or **). Use glob() to match user-defined path to actual paths
7474
for matched_path in repo_root.glob(ignore_path):
7575
if matched_path.is_file():
@@ -88,16 +88,15 @@ def get_ignore_files(repo_root: Path, ignore_paths: List[str]) -> Set[Path]:
8888
def get_repo_files(repo_root: Path) -> List[Path]:
8989
"""Get the list of all repo files, ignoring undesired files & directories specified in .feastignore"""
9090
# Read ignore paths from .feastignore and create a set of all files that match any of these paths
91-
ignore_paths = read_feastignore(repo_root)
92-
ignore_files = get_ignore_files(repo_root, ignore_paths)
93-
ignore_paths += [
91+
ignore_paths = read_feastignore(repo_root) + [
9492
".git",
9593
".feastignore",
9694
".venv",
9795
".pytest_cache",
9896
"__pycache__",
9997
".ipynb_checkpoints",
10098
]
99+
ignore_files = get_ignore_files(repo_root, ignore_paths)
101100

102101
# List all Python files in the root directory (recursively)
103102
repo_files = {

sdk/python/tests/unit/infra/scaffolding/test_repo_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def feature_repo(feastignore_contents: Optional[str]):
3030
(repo_root / "bar/subdir1/subdir2").mkdir()
3131

3232
(repo_root / "a.py").touch()
33-
(repo_root / ".ipynb_checkpoints/test-checkpoint.ipynb").touch()
33+
(repo_root / ".ipynb_checkpoints/test-checkpoint.py").touch()
3434
(repo_root / "foo/b.py").touch()
3535
(repo_root / "foo1/c.py").touch()
3636
(repo_root / "foo1/bar/d.py").touch()

0 commit comments

Comments
 (0)