fix: detect duplicate feature view/data source names at parse time - #6756
fix: detect duplicate feature view/data source names at parse time#6756mayuriphad wants to merge 2 commits into
Conversation
Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
2df34a2 to
03e84b3
Compare
|
Hi maintainers — just checking in on this PR since it hasn't had a maintainer review yet. Happy to make any changes needed; let me know if anything's unclear or if I should split/rework it. Thanks for your time! |
|
Potential issues with this approach:
|
…module imports Address review feedback on the duplicate feature view/data source name check added at parse time: - Move the fail-fast validation from parse_repo() (which has no access to CLI flags) into _get_repo_contents(), gated by skip_feature_view_validation so users who explicitly opt out via --skip-feature-view-validation are no longer blocked by it. - Thread skip_feature_view_validation through plan() and apply_total() to _get_repo_contents(), matching how store.plan()/store.apply() already honor the flag. - Rename _validate_feature_views/_validate_data_sources in feature_store.py to public validate_feature_views/validate_data_sources, since repo_operations.py now depends on them across module boundaries. Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
|
Thanks for the thorough review, @ntkathole — pushed fixes for all three:
Verified locally: the early check still fires by default (before Let me know if you'd like anything else adjusted. |
Problem
test_cli_apply_duplicated_featureview_names(and related tests) intermittently fail in CI with:Root cause: duplicate feature view/data source name detection happens deep inside
store.plan()/store.apply()via_validate_feature_views()/_validate_data_sources()infeature_store.py, afterFeatureStoreand its dependencies (Dask, provider, registry) have already been initialized. On process shutdown, slow atexit handlers (Dask thread pool, PySpark JVM) can block long enough that the test harness's subprocess timeout fires and kills the process withSIGKILLbefore any output is flushed — so the real error message is lost and the test sees only an empty, non-zero exit.The CLI also didn't handle
ConflictingFeatureViewNames/DataSourceRepeatNamesException(bothFeastErrorsubclasses) at all — onlyFeastProviderLoginErrorwas caught — so these errors propagated as unhandled tracebacks.Fix
sdk/python/feast/repo_operations.py: call the existing_validate_feature_views()/_validate_data_sources()validators (imported fromfeature_store.py, no logic duplicated) at the end ofparse_repo(), right after the repo contents are collected — before anyFeatureStore/Dask/PySpark initialization happens. This fails fast, close to where the actual problem (duplicate names in the repo) exists.sdk/python/feast/cli/cli.py: addexcept FeastErrorhandling (after the existingFeastProviderLoginErrorhandler) inplan_commandandapply_total_command, so anyFeastError(including these) is surfaced as a clean message viaclick.ClickExceptionwith a non-zero exit code, rather than an unhandled traceback.Testing
Ran the directly affected tests locally (all pass):
Fixes #6417