From 42083664a817e4d4f59dd2c71a9137473b18e80b Mon Sep 17 00:00:00 2001 From: chrisfandrade16 Date: Thu, 12 Sep 2024 15:35:46 -0700 Subject: [PATCH] Add check if Click parameter is a list to split it into a string --- workflow/lifecycle/configure.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/lifecycle/configure.py b/workflow/lifecycle/configure.py index 2856b12..a37b59c 100644 --- a/workflow/lifecycle/configure.py +++ b/workflow/lifecycle/configure.py @@ -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}")