diff --git a/pydra/engine/specs.py b/pydra/engine/specs.py index af152f6f8..a1fc2d6ad 100644 --- a/pydra/engine/specs.py +++ b/pydra/engine/specs.py @@ -636,11 +636,12 @@ def _check_requires(self, fld, inputs): if "requires" in fld.metadata: # if requires is a list of list it is treated as el[0] OR el[1] OR... - if all([isinstance(el, list) for el in fld.metadata["requires"]]): - field_required_OR = fld.metadata["requires"] + required_fields = ensure_list(fld.metadata["requires"]) + if all([isinstance(el, list) for el in required_fields]): + field_required_OR = required_fields # if requires is a list of tuples/strings - I'm creating a 1-el nested list - elif all([isinstance(el, (str, tuple)) for el in fld.metadata["requires"]]): - field_required_OR = [fld.metadata["requires"]] + elif all([isinstance(el, (str, tuple)) for el in required_fields]): + field_required_OR = [required_fields] else: raise Exception( f"requires field can be a list of list, or a list "