fix: Handle hyphon in sqlite project name (#5575) by jfw-ppi · Pull Request #5749 · feast-dev/feast
return values
@model_validator(mode="before")
@field_validator("project") @classmethod def _validate_project_name(cls, v: str) -> str: def _validate_project_name(cls, v: str, info: ValidationInfo) -> str: # Deferred import to avoid circular dependency during package initialization. from feast.repo_operations import is_valid_name
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")