MCPcopy Create free account
hub / github.com/feast-dev/feast / _validate_project_name

Method _validate_project_name

sdk/python/feast/repo_config.py:644–666  ·  view source on GitHub ↗
(cls, v: str, info: ValidationInfo)

Source from the content-addressed store, hash-verified

642 @field_validator("project")
643 @classmethod
644 def _validate_project_name(cls, v: str, info: ValidationInfo) -> str:
645 # Deferred import to avoid circular dependency during package initialization.
646 from feast.repo_operations import is_valid_name
647
648 sqlite_compatible = False
649
650 online_store = info.data.get("online_store") if info else None
651 if online_store is None or online_store == {}:
652 sqlite_compatible = True
653 elif isinstance(online_store, dict):
654 sqlite_compatible = online_store.get("type", "sqlite") == "sqlite"
655
656 if not is_valid_name(v):
657 raise ValueError(
658 f"Project name, {v}, should only have "
659 f"alphanumerical values, underscores, and hyphens but not start with an underscore or hyphen."
660 )
661
662 if sqlite_compatible and "-" in v:
663 raise ValueError(
664 "Project names for SQLite online stores cannot contain hyphens because they are used in table names."
665 )
666 return v
667
668 @field_validator("flags")
669 @classmethod

Callers

nothing calls this directly

Calls 2

is_valid_nameFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected