| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 18a4e83 commit b8346ff
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -447,6 +447,7 @@ def _validate_online_store_config(cls, values: Any) -> Any: | |||
| 447 | 447 | online_config_class(**values["online_store"]) | |
| 448 | 448 | except ValidationError as e: | |
| 449 | 449 | raise e | |
| 450 | + | ||
| 450 | 451 | return values | |
| 451 | 452 | ||
| 452 | 453 | @model_validator(mode="before") | |
@@ -502,14 +503,28 @@ def _validate_feature_server_config(cls, values: Any) -> Any: | |||
| 502 | 503 | ||
| 503 | 504 | @field_validator("project") | |
| 504 | 505 | @classmethod | |
| 505 | - def _validate_project_name(cls, v: str) -> str: | ||
| 506 | + def _validate_project_name(cls, v: str, info: ValidationInfo) -> str: | ||
| 507 | + # Deferred import to avoid circular dependency during package initialization. | ||
| 506 | 508 | from feast.repo_operations import is_valid_name | |
| 507 | 509 | ||
| 510 | + sqlite_compatible = False | ||
| 511 | + | ||
| 512 | + online_store = info.data.get("online_store") if info else None | ||
| 513 | + if online_store is None or online_store == {}: | ||
| 514 | + sqlite_compatible = True | ||
| 515 | + elif isinstance(online_store, dict): | ||
| 516 | + sqlite_compatible = online_store.get("type", "sqlite") == "sqlite" | ||
| 517 | + | ||
| 508 | 518 | if not is_valid_name(v): | |
| 509 | 519 | raise ValueError( | |
| 510 | 520 | f"Project name, {v}, should only have " | |
| 511 | 521 | f"alphanumerical values, underscores, and hyphens but not start with an underscore or hyphen." | |
| 512 | 522 | ) | |
| 523 | + | ||
| 524 | + if sqlite_compatible and "-" in v: | ||
| 525 | + raise ValueError( | ||
| 526 | + "Project names for SQLite online stores cannot contain hyphens because they are used in table names." | ||
| 527 | + ) | ||
| 513 | 528 | return v | |
| 514 | 529 | ||
| 515 | 530 | @field_validator("flags") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments