Visitar URL original
fix: Handle hyphon in sqlite project name (#5575) by jfw-ppi · Pull Request #5749 · feast-dev/feast · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: handle hyphon in sqlite project name (#5575)
Signed-off-by: Jacob Weinhold <29459386+jfw-ppi@users.noreply.github.com>
  • Loading branch information
jfw-ppi authored and ntkathole committed Dec 2, 2025
commit 45d424efba97d974ff4b3955ddb8ae9032348e85
17 changes: 15 additions & 2 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)
from feast.importer import import_class
from feast.permissions.auth.auth_type import AuthType
from feast.repo_operations import is_valid_name

warnings.simplefilter("once", RuntimeWarning)

Expand Down Expand Up @@ -447,6 +448,7 @@ def _validate_online_store_config(cls, values: Any) -> Any:
online_config_class(**values["online_store"])
except ValidationError as e:
raise e

return values

@model_validator(mode="before")
Expand Down Expand Up @@ -502,14 +504,25 @@ def _validate_feature_server_config(cls, values: Any) -> Any:

@field_validator("project")
@classmethod
def _validate_project_name(cls, v: str) -> str:
from feast.repo_operations import is_valid_name
def _validate_project_name(cls, v: str, info: ValidationInfo) -> str:
sqlite_compatible = False

online_store = info.data.get("online_store") if info else None
if online_store is None or online_store == {}:
sqlite_compatible = True
elif isinstance(online_store, dict):
sqlite_compatible = online_store.get("type", "sqlite") == "sqlite"

if not is_valid_name(v):
raise ValueError(
f"Project name, {v}, should only have "
f"alphanumerical values, underscores, and hyphens but not start with an underscore or hyphen."
)

if sqlite_compatible and "-" in v:
raise ValueError(
"Project names for SQLite online stores cannot contain hyphens because they are used in table names."
)
return v

@field_validator("flags")
Expand Down