MCPcopy Create free account
hub / github.com/feast-dev/feast / read_feastignore

Function read_feastignore

sdk/python/feast/repo_operations.py:51–67  ·  view source on GitHub ↗

Read .feastignore in the repo root directory (if exists) and return the list of user-defined ignore paths

(repo_root: Path)

Source from the content-addressed store, hash-verified

49
50
51def read_feastignore(repo_root: Path) -> List[str]:
52 """Read .feastignore in the repo root directory (if exists) and return the list of user-defined ignore paths"""
53 feast_ignore = repo_root / ".feastignore"
54 if not feast_ignore.is_file():
55 return []
56 lines = feast_ignore.read_text().strip().split("\n")
57 ignore_paths = []
58 for line in lines:
59 # Remove everything after the first occurance of "#" symbol (comments)
60 if line.find("#") >= 0:
61 line = line[: line.find("#")]
62 # Strip leading or ending whitespaces
63 line = line.strip()
64 # Add this processed line to ignore_paths if it's not empty
65 if len(line) > 0:
66 ignore_paths.append(line)
67 return ignore_paths
68
69
70def get_ignore_files(repo_root: Path, ignore_paths: List[str]) -> Set[Path]:

Callers 5

test_feastignore_no_fileFunction · 0.90
get_repo_filesFunction · 0.85

Calls 1

read_textMethod · 0.45

Tested by 4

test_feastignore_no_fileFunction · 0.72