Skip to content

Commit

Permalink
Add check if Click parameter is a list to split it into a string
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfandrade16 committed Sep 12, 2024
1 parent 4ced9fa commit 4208366
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workflow/lifecycle/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ def arguments(func: Callable[..., Any], work: Work) -> List[str]:
List[str]: List of CLI arguments
"""
args: List[str] = []

for parameter in func.params:
parameter_name_in_cli = parameter.opts[-1]
paraneter_name_in_function = parameter.name
parameter_value_in_work = work.parameters.get(paraneter_name_in_function, None)

if parameter_value_in_work:
if isinstance(parameter_value_in_work, list):
parameter_value_in_work = " ".join(parameter_value_in_work)

if isinstance(parameter, click.Argument):
# If argument, then the parameter is purely positional without a key
args.append(f"{parameter_value_in_work}")
Expand Down

0 comments on commit 4208366

Please sign in to comment.