From 036b05bc4598172092f7919502409a68b010fc6a Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 18 Feb 2024 01:32:24 -0500 Subject: [PATCH] Rebase into models. --- lib/galaxy/tool_util/parameters/models.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tool_util/parameters/models.py b/lib/galaxy/tool_util/parameters/models.py index f48e728b0eb3..d7f1a9d3dc86 100644 --- a/lib/galaxy/tool_util/parameters/models.py +++ b/lib/galaxy/tool_util/parameters/models.py @@ -515,7 +515,8 @@ def pydantic_template(self, state_representation: StateRepresentationT) -> Dynam extra_kwd = {test_param_name: (Union[str, bool], initialize_test)} when_types.append( - cast(Type[BaseModel], + cast( + Type[BaseModel], Annotated[ create_field_model( parameters, @@ -525,7 +526,7 @@ def pydantic_template(self, state_representation: StateRepresentationT) -> Dynam extra_validators=extra_validators, ), Tag(str(discriminator)), - ] + ], ) ) if when.is_default_when: @@ -537,10 +538,7 @@ def pydantic_template(self, state_representation: StateRepresentationT) -> Dynam extra_kwd=extra_kwd, extra_validators={}, ) - when_types.append( - cast(Type[BaseModel], - Annotated[default_type, Tag("__absent__")]) - ) + when_types.append(cast(Type[BaseModel], Annotated[default_type, Tag("__absent__")])) def model_x_discriminator(v: Any) -> str: if test_param_name not in v: