Skip to content

Commit

Permalink
Fix subflow type annotation, which was wrong (#173)
Browse files Browse the repository at this point in the history
it wasn't caught in older versions of pydantic because (I think)
the Self keyword was not supported yet.
  • Loading branch information
PGijsbers authored Jul 21, 2024
1 parent 5d0181f commit 5720351
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/schemas/flows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from datetime import datetime
from typing import Any, Self
from typing import Any, TypedDict

from pydantic import BaseModel, ConfigDict, Field

Expand All @@ -23,7 +25,12 @@ class Flow(BaseModel):
language: str | None = Field(max_length=128)
dependencies: str | None
parameter: list[Parameter]
subflows: list[Self]
subflows: list[Subflow]
tag: list[str]

model_config = ConfigDict(arbitrary_types_allowed=True)


class Subflow(TypedDict):
identifier: str | None
flow: Flow

0 comments on commit 5720351

Please sign in to comment.