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
Prev Previous commit
feat: Generate absolute paths for file-based registry and online stor…
…e when issuing 'feast init' commands
  • Loading branch information
boliri committed Nov 20, 2024
commit 2425d69848f2b6ecdad09d899e59c32ea0391cf9
19 changes: 18 additions & 1 deletion sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,28 @@ def init_repo(repo_name: str, template: str):
os.remove(bootstrap_path)

# Template the feature_store.yaml file
feature_store_yaml_path = repo_path / "feature_repo" / "feature_store.yaml"
feature_repo_path = repo_path / "feature_repo"
feature_store_yaml_path = feature_repo_path / "feature_store.yaml"

# user-defined project name
replace_str_in_file(
feature_store_yaml_path, "project: my_project", f"project: {repo_name}"
)

# registry: replace relative path from template with absolute path
replace_str_in_file(
feature_store_yaml_path,
"registry: data/registry.db",
f"registry: {feature_repo_path}/data/registry.db",
)

# online store: replace relative path from template with absolute path
replace_str_in_file(
feature_store_yaml_path,
"path: data/online_store.db",
f"path: {feature_repo_path}/data/online_store.db",
)

# Remove the __pycache__ folder if it exists
import shutil

Expand Down