Skip to content

Commit

Permalink
Rebase into models.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Feb 18, 2024
1 parent 925b450 commit 036b05b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/galaxy/tool_util/parameters/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -525,7 +526,7 @@ def pydantic_template(self, state_representation: StateRepresentationT) -> Dynam
extra_validators=extra_validators,
),
Tag(str(discriminator)),
]
],
)
)
if when.is_default_when:
Expand All @@ -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:
Expand Down

0 comments on commit 036b05b

Please sign in to comment.