Skip to content

Commit

Permalink
Reuse add_metadata_from_type
Browse files Browse the repository at this point in the history
Signed-off-by: Alice Purcell <[email protected]>
  • Loading branch information
alicederyn committed Nov 6, 2024
1 parent 2831dfd commit fa6a37f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hera/shared/_type_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ def construct_io_from_annotation(python_name: str, annotation: Any) -> Union[Par
io = Parameter()

io.name = io.name or python_name
if isinstance(io, Parameter) and not io.enum:
type_ = unwrap_annotation(annotation)
if get_origin(type_) is Literal:
io.enum = list(get_args(type_))
if isinstance(io, Parameter):
add_metadata_from_type(io, annotation)

return io

Expand Down

0 comments on commit fa6a37f

Please sign in to comment.