Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add possibility to define feature_store.yaml path with env variable #3231

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def cli(
ctx.obj["FS_YAML_FILE"] = (
Path(feature_store_yaml).absolute()
if feature_store_yaml
else ctx.obj["CHDIR"] / "feature_store.yaml"
else utils.get_default_yaml_file_path(ctx.obj["CHDIR"])
felixwang9817 marked this conversation as resolved.
Show resolved Hide resolved
)
try:
level = getattr(logging, log_level.upper())
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(
self.config = load_repo_config(self.repo_path, fs_yaml_file)
else:
self.config = load_repo_config(
self.repo_path, Path(self.repo_path) / "feature_store.yaml"
self.repo_path, utils.get_default_yaml_file_path(self.repo_path)
)

registry_config = self.config.get_registry_config()
Expand Down
10 changes: 10 additions & 0 deletions sdk/python/feast/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import typing
from collections import defaultdict
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union

import pandas as pd
Expand Down Expand Up @@ -51,6 +53,14 @@ def maybe_local_tz(t: datetime) -> datetime:
return t


def get_default_yaml_file_path(repo_path: Path) -> Path:
if "FEAST_FS_YAML_FILE_PATH" in os.environ:
yaml_path = os.environ["FEAST_FS_YAML_FILE_PATH"]
return Path(yaml_path) / "feature_store.yaml"
else:
return repo_path / "feature_store.yaml"


def _get_requested_feature_views_to_features_dict(
feature_refs: List[str],
feature_views: List["FeatureView"],
Expand Down