Skip to content
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
Prev Previous commit
Next Next commit
tests
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals committed Aug 15, 2022
commit df6a8e1b1439efc12372ac86bbf132d46d5ad6e5
2 changes: 2 additions & 0 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def __init__(
else:
self.repo_path = Path(os.getcwd())

# If config is specified, or fs_yaml_file is specified, those take precedence over
# the default feature_store.yaml location under repo_path.
if config is not None:
self.config = config
elif fs_yaml_file is not None:
Expand Down
17 changes: 15 additions & 2 deletions sdk/python/tests/unit/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ def test_3rd_party_registry_store() -> None:
assertpy.assert_that(return_code).is_equal_to(0)


def test_3rd_party_registry_store_with_fs_yaml_override() -> None:
runner = CliRunner()

fs_yaml_file = "test_fs.yaml"
with setup_third_party_registry_store_repo(
"foo.registry_store.FooRegistryStore",
fs_yaml_file_name=fs_yaml_file
) as repo_path:
return_code, output = runner.run_with_output(["--feature-store-yaml", fs_yaml_file, "apply"], cwd=repo_path)
assertpy.assert_that(return_code).is_equal_to(0)


@contextmanager
def setup_third_party_provider_repo(provider_name: str):
with tempfile.TemporaryDirectory() as repo_dir_name:
Expand Down Expand Up @@ -106,13 +118,14 @@ def setup_third_party_provider_repo(provider_name: str):


@contextmanager
def setup_third_party_registry_store_repo(registry_store: str):
def setup_third_party_registry_store_repo(registry_store: str,
fs_yaml_file_name: str = "feature_store.yaml"):
with tempfile.TemporaryDirectory() as repo_dir_name:

# Construct an example repo in a temporary dir
repo_path = Path(repo_dir_name)

repo_config = repo_path / "feature_store.yaml"
repo_config = repo_path / fs_yaml_file_name

repo_config.write_text(
dedent(
Expand Down