File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
packages/dask-task-models-library/src/dask_task_models_library/container_tasks Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 11import json
22from contextlib import suppress
33from pathlib import Path
4- from typing import Any , TypeAlias , Union
4+ from typing import Annotated , Any , TypeAlias
55
66from models_library .basic_regex import MIME_TYPE_RE
77from models_library .generics import DictModel
@@ -84,15 +84,16 @@ class FileUrl(BaseModel):
8484 )
8585
8686
87- PortValue : TypeAlias = Union [
88- StrictBool ,
89- StrictInt ,
90- StrictFloat ,
91- StrictStr ,
92- FileUrl ,
93- list [Any ],
94- dict [str , Any ],
95- None ,
87+ PortValue : TypeAlias = Annotated [
88+ StrictBool
89+ | StrictInt
90+ | StrictFloat
91+ | StrictStr
92+ | FileUrl
93+ | list [Any ]
94+ | dict [str , Any ]
95+ | None ,
96+ Field (union_mode = "left_to_right" ),
9697]
9798
9899
@@ -112,7 +113,9 @@ class TaskInputData(DictModel[ServicePortKey, PortValue]):
112113 )
113114
114115
115- PortSchemaValue : TypeAlias = Union [PortSchema , FilePortSchema ]
116+ PortSchemaValue : TypeAlias = Annotated [
117+ PortSchema | FilePortSchema , Field (union_mode = "left_to_right" )
118+ ]
116119
117120
118121class TaskOutputDataSchema (DictModel [ServicePortKey , PortSchemaValue ]):
You can’t perform that action at this time.
0 commit comments