Skip to content

Commit 945b0fa

Browse files
fix: Updating the documentation and adding tests for project length (#4628)
Updated the documentation to make it clear after spending some time. Addressing the issue - #4626 Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com>
1 parent 043eff1 commit 945b0fa

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

sdk/python/feast/repo_config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ class RepoConfig(FeastBaseModel):
158158
"""Repo config. Typically loaded from `feature_store.yaml`"""
159159

160160
project: StrictStr
161-
""" str: Feast project id. This can be any alphanumeric string up to 16 characters.
161+
""" str: This acts as a Feast unique project identifier. This can be any alphanumeric string and can have '_' but can not start with '_'.
162162
You can have multiple independent feature repositories deployed to the same cloud
163-
provider account, as long as they have different project ids.
163+
provider account, as long as they have different project identifier.
164164
"""
165165

166166
provider: StrictStr = "local"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from sdk.python.feast.repo_operations import is_valid_name
2+
3+
4+
def test_is_valid_name():
5+
test_cases = [
6+
# Valid project name cases
7+
("valid_name1", True),
8+
("username_1234", True),
9+
("valid123", True),
10+
("1234567890123456", True),
11+
("invalid_name_", True),
12+
("12345678901234567", True),
13+
("too_long_name_123", True),
14+
# Invalid project name cases
15+
("_invalidName", False),
16+
("invalid-Name", False),
17+
("invalid name", False),
18+
("invalid@name", False),
19+
("invalid$name", False),
20+
("__", False),
21+
]
22+
23+
for name, expected in test_cases:
24+
assert (
25+
is_valid_name(name) == expected
26+
), f"Failed for project invalid name: {name}"

0 commit comments

Comments
 (0)