fix: Validate SQLite project names during init - #6809
angelo-lacson wants to merge 1 commit into
Conversation
angelo-lacson
left a comment
There was a problem hiding this comment.
Hi, maintainers, this PR is ready for review and the workflows are awaiting approval, Thanks!
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6809 +/- ##
==========================================
- Coverage 47.11% 47.11% -0.01%
==========================================
Files 419 419
Lines 51886 51889 +3
Branches 7528 7529 +1
==========================================
Hits 24448 24448
- Misses 25688 25690 +2
- Partials 1750 1751 +1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Signed-off-by: Angelo Lacson <[email protected]>
46ff878 to
c374b50
Compare
|
|
||
| if "-" in repo_name and template.lower() in _SQLITE_ONLINE_STORE_TEMPLATES: | ||
| raise BadParameter( | ||
| message="Project names for SQLite online stores cannot contain hyphens because they are used in table names.", |
There was a problem hiding this comment.
@angelo-lacson Thanks for PR, this looks good!
Can you also consider a shared helper with repo_config._validate_project_name so the error message and SQLite rule stay in one place ? Currently there is duplication of error messages between this and #5749
What this PR does / why we need it:
feast initcurrently accepts a hyphenated project name for the default local template, then generates a repository that cannot load because its SQLite online store rejects that name.This change validates the project name against the selected built-in template before creating the target directory. SQLite-backed templates now return the existing SQLite-specific error immediately, while the general project-name validator continues to allow hyphens.
The PR implements option 2 proposed in the issue and is a draft pending maintainer confirmation of that behavior.
Which issue(s) this PR fixes:
Fixes #6808
Checks
git commit -s)Testing Strategy
Also verified the changed files with Ruff formatting and lint checks.
Misc
The regression test confirms that
feast init hyphen-namefails with the SQLite-specific message and does not leave a partially generated directory.