fix: allow feast init to accept a path as PROJECT_DIRECTORY (#6134) - #6680
Open
karandhaodiyal28-hash wants to merge 1 commit into
Open
Conversation
feast init /tmp/test failed with a project-name validation error because the whole path was validated as the project name. When PROJECT_DIRECTORY contains a path separator and no explicit --repo-path is given, treat the argument as the target directory and derive the project name from its final path component. Invalid basenames are still rejected. Fixes feast-dev#6134. Signed-off-by: Karan Dhaodiyal <256503836+karandhaodiyal28-hash@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6680 +/- ##
==========================================
+ Coverage 46.45% 46.74% +0.28%
==========================================
Files 414 414
Lines 50136 50176 +40
Branches 7173 7180 +7
==========================================
+ Hits 23293 23454 +161
+ Misses 25204 25082 -122
- Partials 1639 1640 +1
... and 21 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
feast initaccepts a positionalPROJECT_DIRECTORYargument, but passing a path currently fails:The argument is validated as a project name (
is_valid_name), so any path separator (/,\) is rejected — even though the argument is literally namedPROJECT_DIRECTORYand users reasonably expect to scaffold into a directory (e.g.feast init /tmp/testorfeast init my/sub/dir).Change
In
init_repo, whenPROJECT_DIRECTORYcontains a path separator and no explicit--repo-pathis provided, treat the argument as the target directory and derive the project name from its final path component. The derived name is then validated as before.Behavior with an explicit
--repo-path, and plain project names, is unchanged.Which issue(s) this PR fixes
Fixes #6134
Testing
test_repo_init_with_path_argumentinsdk/python/tests/unit/local_feast_tests/test_init.py— runsfeast init <path>via the CLI runner and asserts the repo is scaffolded at the path with the project name derived from the basename./tmp/test→test;my/sub/dir→dir;/tmp/_badstill rejected; explicit--repo-pathunchanged).Note: I couldn't run the full test suite locally —
import feastfails on my machine due to apyarrow_substraitDLL being blocked by an OS Application-Control policy (unrelated to this change). The validation/derivation logic is small and pure, and the added regression test exercises the end-to-end CLI path in CI.