Skip to content

Commit

Permalink
fix(variants): do not use NamedTuple as it changes ResponseModel
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Mar 6, 2024
1 parent 9ef7df1 commit 42c8c25
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions antarest/study/storage/variantstudy/model/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, NamedTuple, Optional, Tuple, Union
from typing import List, Optional, Tuple, Union

from pydantic import BaseModel

Expand Down Expand Up @@ -26,7 +26,8 @@ class CommandResultDTO(BaseModel):
message: str


class VariantTreeDTO(NamedTuple):
class VariantTreeDTO:
# Don't use BaseModel as this could trigger Recursion exceptions, since we're using Pydantic with a version prior to v2.
node: StudyMetadataDTO
children: List["VariantTreeDTO"]
def __init__(self, node: StudyMetadataDTO, children: List["VariantTreeDTO"]) -> None:
self.node = node
self.children = children

0 comments on commit 42c8c25

Please sign in to comment.