gentle-scientist-22504
08/27/2025, 7:12 PMdef *train_aggregator*(_fold_: str) -> str:
in workflow: map_task(train_aggregator)(_fold_=['fold1', 'fold2'])
but error is complaining about mismatch between string and list of strings
he output variable 'main.map_train_aggregator_6b3bd0353da5de6e84d7982921ead2b3-arraynode.o0' has type [collection_type:{simple:STRING}], but it's assigned to the input variable 'o0' which has type type [simple:STRING].
from my understanding, and confirmed by LLM, map_task should handle thisproud-glass-36655
08/27/2025, 7:27 PMmap_task(train_aggregator)(_fold_=['fold1', 'fold2'])
will also return a list[str]
rather than just str
-- is your workflow properly expecting that return value to be a list?gentle-scientist-22504
08/27/2025, 7:30 PMgentle-scientist-22504
08/27/2025, 7:30 PMproud-glass-36655
08/27/2025, 7:30 PMgentle-scientist-22504
08/27/2025, 7:41 PMproud-glass-36655
08/27/2025, 7:42 PMpartial
task to do that (but to answer your specific question, the output won't change)proud-glass-36655
08/27/2025, 7:43 PMproud-glass-36655
08/27/2025, 7:43 PMimport functools
@workflow
def multiple_inputs_map_workflow(list_q: list[int] = [1, 2, 3, 4, 5], p: float = 6.0, s: float = 7.0) -> list[float]:
partial_task = functools.partial(multi_input_task, price=p, shipping=s)
return map_task(partial_task)(quantity=list_q)
so you just pass the list you want to loop over into the map_task
, the rest (constant args) get defined as the partial
gentle-scientist-22504
08/27/2025, 7:44 PMproud-glass-36655
08/27/2025, 7:44 PM