Skip to content

Commit

Permalink
feat: Generate absolute paths for file-based registry and online stor…
Browse files Browse the repository at this point in the history
…e when issuing 'feast init' commands
  • Loading branch information
boliri committed Nov 20, 2024
1 parent 00ece9c commit 2425d69
Showing 1 changed file with 18 additions and 1 deletion.
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

0 comments on commit 2425d69

Please sign in to comment.