From 4da1feffdfe6233efb348e9417c775669114428e Mon Sep 17 00:00:00 2001 From: belthlemar Date: Tue, 5 Mar 2024 10:04:29 +0100 Subject: [PATCH] fix(variants): do not use NamedTuple as it changes ResponseModel --- antarest/study/storage/variantstudy/model/model.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/antarest/study/storage/variantstudy/model/model.py b/antarest/study/storage/variantstudy/model/model.py index 3d881f6429..4b2e15e2c1 100644 --- a/antarest/study/storage/variantstudy/model/model.py +++ b/antarest/study/storage/variantstudy/model/model.py @@ -1,4 +1,4 @@ -from typing import List, NamedTuple, Optional, Tuple, Union +from typing import List, Optional, Tuple, Union from pydantic import BaseModel @@ -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