Kamil Okáč
11/26/2019, 9:49 AMfrom prefect import Flow, task
@task
def arrtest(arr):
return ''.join(arr)
with Flow('ArrayTest') as flow:
r = arrtest(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'])
print(flow.run().result[r].result)
Expected result: abcdefghijk
Actual result: ajkbcdefghiJenny
11/26/2019, 1:57 PMConstant
which prevents Prefect's auto-task mechanism from parsing it.list_input =prefect.tasks.core.constants.Constant([1,2,3])
Kamil Okáč
11/26/2019, 3:02 PMalexandre kempf
12/04/2019, 3:59 PMjosh
12/04/2019, 4:37 PMParameter
because Parameters are a special kind of task. What is happening here is a list is being defined directly in the context of the Flow and therefore is being converted into a Constant
(which is also a special type of task).nicholas
12/04/2019, 4:37 PMalexandre kempf
12/04/2019, 4:44 PMConstant
, and this is why it can be reorder.
Can a task (here r
for example) be reorder if it goes through another task ? (Imagine r
is a task with a list as a result, and you give it to another task) or task are also a special type ?
If this question is not clear I can provide an example, don't hesitate to ask about it if needed 🙂josh
12/04/2019, 4:45 PMalexandre kempf
12/04/2019, 4:46 PMMark Koob
12/04/2019, 9:02 PM