Skip to content

Commit 6a1b33a

Browse files
authored
feat: Allow to use env variable FEAST_FS_YAML_FILE_PATH and FEATURE_REPO_DIR (#5420)
feat: Allow to use env variable FEATURE_STORE_YAML_PATH and FEATURE_REPO_DIR Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent eb0e799 commit 6a1b33a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

sdk/python/feast/cli/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from feast.cli.stream_feature_views import stream_feature_views_cmd
4848
from feast.cli.ui import ui
4949
from feast.cli.validation_references import validation_references_cmd
50+
from feast.constants import FEAST_FS_YAML_FILE_PATH_ENV_NAME
5051
from feast.errors import FeastProviderLoginError
5152
from feast.repo_config import load_repo_config
5253
from feast.repo_operations import (
@@ -81,7 +82,8 @@ def format_options(self, ctx: click.Context, formatter: click.HelpFormatter):
8182
@click.option(
8283
"--chdir",
8384
"-c",
84-
help="Switch to a different feature repository directory before executing the given subcommand.",
85+
envvar="FEATURE_REPO_DIR_ENV_VAR",
86+
help="Switch to a different feature repository directory before executing the given subcommand. Can also be set via the FEATURE_REPO_DIR_ENV_VAR environment variable.",
8587
)
8688
@click.option(
8789
"--log-level",
@@ -91,7 +93,7 @@ def format_options(self, ctx: click.Context, formatter: click.HelpFormatter):
9193
@click.option(
9294
"--feature-store-yaml",
9395
"-f",
94-
help="Override the directory where the CLI should look for the feature_store.yaml file.",
96+
help=f"Override the directory where the CLI should look for the feature_store.yaml file. Can also be set via the {FEAST_FS_YAML_FILE_PATH_ENV_NAME} environment variable.",
9597
)
9698
@click.pass_context
9799
def cli(

sdk/python/tests/unit/transformation/test_spark_transformation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def remove_extra_spaces_sql(df, column_name):
5353
@pytest.fixture
5454
def spark_fixture():
5555
spark = SparkSession.builder.appName("Testing PySpark Example").getOrCreate()
56-
yield spark
56+
try:
57+
yield spark
58+
finally:
59+
spark.stop()
5760

5861

5962
@patch("feast.infra.compute_engines.spark.utils.get_or_create_new_spark_session")

0 commit comments

Comments
 (0)