Skip to content

Commit

Permalink
fix: Updating the documentation and adding tests for project length (#…
Browse files Browse the repository at this point in the history
…4628)

Updated the documentation to make it clear after spending some time.
 Addressing the issue - #4626

Signed-off-by: lrangine <[email protected]>
  • Loading branch information
lokeshrangineni authored Oct 14, 2024
1 parent 043eff1 commit 945b0fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ class RepoConfig(FeastBaseModel):
"""Repo config. Typically loaded from `feature_store.yaml`"""

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

provider: StrictStr = "local"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from sdk.python.feast.repo_operations import is_valid_name


def test_is_valid_name():
test_cases = [
# Valid project name cases
("valid_name1", True),
("username_1234", True),
("valid123", True),
("1234567890123456", True),
("invalid_name_", True),
("12345678901234567", True),
("too_long_name_123", True),
# Invalid project name cases
("_invalidName", False),
("invalid-Name", False),
("invalid name", False),
("invalid@name", False),
("invalid$name", False),
("__", False),
]

for name, expected in test_cases:
assert (
is_valid_name(name) == expected
), f"Failed for project invalid name: {name}"

0 comments on commit 945b0fa

Please sign in to comment.