Skip to content

Commit

Permalink
tune
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 25, 2024
1 parent fe2ab29 commit 372a3ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apolo_flow/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
PlatformResourceURIExpr,
PrimitiveExpr,
RemotePathExpr,
RemovedStrExpr,
SequenceT,
SimpleIdExpr,
SimpleOptBoolExpr,
Expand Down Expand Up @@ -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})
Expand Down
7 changes: 7 additions & 0 deletions src/apolo_flow/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 372a3ed

Please sign in to comment.