Skip to content

Commit e4e7cb0

Browse files
committed
More robust coercion of output paths to FileSets handles nested types (e.g. unions and lists)
1 parent 72f9a6b commit e4e7cb0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pydra/engine/specs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from copy import copy
88
from glob import glob
99
import attr
10+
from fileformats.core import FileSet
1011
from fileformats.generic import (
1112
File,
1213
Directory,
@@ -435,8 +436,8 @@ def collect_additional_outputs(self, inputs, output_dir, outputs):
435436
# assuming that field should have either default or metadata, but not both
436437
input_value = getattr(inputs, fld.name, attr.NOTHING)
437438
if input_value is not attr.NOTHING:
438-
if issubclass(fld.type, os.PathLike):
439-
input_value = fld.type(input_value)
439+
if TypeParser.contains_type(FileSet, fld.type):
440+
input_value = TypeParser(fld.type).coerce(input_value)
440441
additional_out[fld.name] = input_value
441442
elif (
442443
fld.default is None or fld.default == attr.NOTHING

0 commit comments

Comments
 (0)