diff --git a/src/apolo_flow/ast.py b/src/apolo_flow/ast.py index 19bd0131..0878017b 100644 --- a/src/apolo_flow/ast.py +++ b/src/apolo_flow/ast.py @@ -21,6 +21,7 @@ PlatformResourceURIExpr, PrimitiveExpr, RemotePathExpr, + RemovedStrExpr, SequenceT, SimpleIdExpr, SimpleOptBoolExpr, @@ -64,6 +65,9 @@ class Project(Base): id: SimpleIdExpr project_name: SimpleOptStrExpr # project name can contain "-" owner: SimpleOptStrExpr # user name can contain "-" + role: ( + RemovedStrExpr # keep it here for a while for the sake of better error message + ) images: Optional[Mapping[str, "Image"]] = field(metadata={"allow_none": True}) volumes: Optional[Mapping[str, "Volume"]] = field(metadata={"allow_none": True}) diff --git a/src/apolo_flow/expr.py b/src/apolo_flow/expr.py index 51d741f5..ffa47f5b 100644 --- a/src/apolo_flow/expr.py +++ b/src/apolo_flow/expr.py @@ -1318,6 +1318,13 @@ class SimpleOptStrExpr(StrExprMixin, NoExprMixin, Expr[str]): pass +class RemovedStrExpr(NoExprMixin, StrictExpr[str]): + type_name: ClassVar[str] = "str" + + def convert(self, arg: TypeT) -> str: + raise ValueError("The field is not suppored anymore, {!r} passed") + + class IdExprMixin: type_name: ClassVar[str] = "id"