Akshay Verma
08/19/2019, 1:04 PM'FunctionTask' object is not iterable
error. Can anyone point me out, what it is?Jeremiah
Akshay Verma
08/19/2019, 1:11 PM@task
def generate_context_level_data(mlsi, lvnr, tol):
ml, ci = td_split_clv(mlsi, lvnr, tol)
return ml, ci
td_input = {'a': 1, 'b': 2, 'c': 3}
with Flow('TD') as flow:
td_input = Parameter("td_input")
context_level_ml, context_level_ci = generate_context_level_data(td_input['a'],
td_input['b'],
td_input['c'])
Jeremiah
generate_context_level_data
to two variables (context_level_ml
and context_level_ci
), but Prefect doesn’t know what the result of generate_context_level_data
is, so Python can’t do that unpacking.context_result = generate_context_level_data(...)
context_level_ml = context_result[0]
context_level_ci = context_result[1]
context_result
, but not unpack it.generate_context_level_data
but this pattern should work — return a single object from your task, then index it appropriately)Akshay Verma
08/19/2019, 1:22 PMJeremiah
Akshay Verma
08/19/2019, 1:47 PMtask
.Chris White
Marvin
08/19/2019, 6:13 PM