From f48eebbdb44ad739ca2aafbe43064948e4e7b0ae Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 22 May 2023 19:28:27 +0200 Subject: [PATCH] FIX: Discard lazy fields in template type checks --- pydra/engine/helpers_file.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pydra/engine/helpers_file.py b/pydra/engine/helpers_file.py index 5a408923b7..f12ebe5a8d 100644 --- a/pydra/engine/helpers_file.py +++ b/pydra/engine/helpers_file.py @@ -628,7 +628,7 @@ def template_update_single( based on the value from inputs_dict (checking the types of the fields, that have "output_file_template)" """ - from .specs import File, MultiOutputFile, Directory + from .specs import File, MultiOutputFile, Directory, LazyField # if input_dict_st with state specific value is not available, # the dictionary will be created from inputs object @@ -642,7 +642,9 @@ def template_update_single( "has to be a string or Union[str, bool]" ) inp_val_set = inputs_dict_st[field.name] - if inp_val_set is not attr.NOTHING and not isinstance(inp_val_set, (str, bool)): + if inp_val_set is not attr.NOTHING and not isinstance( + inp_val_set, (str, bool, LazyField) + ): raise Exception( f"{field.name} has to be str or bool, but {inp_val_set} set" )