(cls, v: str, info: ValidationInfo)
| 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 |
nothing calls this directly
no test coverage detected