Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion sdk/python/feast/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
from feast.cli.ui import ui
from feast.cli.validation_references import validation_references_cmd
from feast.constants import FEAST_FS_YAML_FILE_PATH_ENV_NAME
from feast.errors import FeastProviderLoginError
from feast.errors import FeastError, FeastProviderLoginError
from feast.repo_config import load_repo_config
from feast.repo_operations import (
apply_total,
Expand Down Expand Up @@ -261,6 +261,8 @@ def plan_command(
plan(repo_config, repo, skip_source_validation, skip_feature_view_validation)
except FeastProviderLoginError as e:
print(str(e))
except FeastError as e:
raise click.ClickException(str(e))


@cli.command("apply", cls=NoOptionDefaultFormat)
Expand Down Expand Up @@ -319,6 +321,8 @@ def apply_total_command(
)
except FeastProviderLoginError as e:
print(str(e))
except FeastError as e:
raise click.ClickException(str(e))


@cli.command("teardown", cls=NoOptionDefaultFormat)
Expand Down
20 changes: 19 additions & 1 deletion sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
from feast.diff.registry_diff import extract_objects_for_keep_delete_update_add
from feast.entity import Entity
from feast.feature_service import FeatureService
from feast.feature_store import FeatureStore
from feast.feature_store import (
FeatureStore,
_validate_data_sources,
_validate_feature_views,
)
from feast.feature_view import DUMMY_ENTITY, FeatureView
from feast.file_utils import replace_str_in_file
from feast.infra.registry.base_registry import BaseRegistry
Expand Down Expand Up @@ -238,6 +242,20 @@ def parse_repo(repo_root: Path) -> RepoContents:
res.projects.append(obj)

res.entities.append(DUMMY_ENTITY)

# Fail fast on duplicate feature view / data source names, before any
# heavy dependencies (FeatureStore, Dask, PySpark) are initialized. See
# https://github.com/feast-dev/feast/issues/6417 - detecting this later,
# inside store.plan()/store.apply(), risks the error being masked by a
# slow subprocess/atexit shutdown timing out before it can be reported.
_validate_feature_views(
res.feature_views
+ res.on_demand_feature_views
+ res.stream_feature_views
+ res.label_views
)
_validate_data_sources(res.data_sources)

return res


Expand Down