Assaf Ben Shimon
04/21/2022, 11:01 PMKevin Kho
04/21/2022, 11:02 PMset_upstream
and set_downstream
but what is Foo? Is that a task?flow.run()
but will break for runs with Prefect Cloud because those are triggered by API requests. Instead, use a string as a default and pass it to an intermediate task to return the function/callable
2. I am unclear at the moment if get_sequences_attr
is a task. If it is a task, you can’t use for
loops on task outputs because for
runs during the Flow build
time, not during flow.run()
. So the Flow is built, but the for
loop doesn’t know how many items there are in the list if it’s a Task. A Task value (including Parameters) are created at runtime. Note the distinction of flow-build and flow-run time. If you need to loop over a task output, you should be looking at mapping.
3. Assuming sequence_attr
is some task output, you can’t do stuff like sequence_attr.get_path()
. This is because that is evaluated during build time when it is still type Task. The value doesn’t exist until runtime. Instead, you need this method class to happen inside a task so logic is deferred. This will work though if sequence_attr
is not a task and already defined during flow-build time.get_sequences_attr
is a function, you can’t pass a Parameter to it because Parameters don’t exist during build time. It will not behave as expected and you are passing the Parameter class as opposed to a Parameter valueflow.run()
Assaf Ben Shimon
04/21/2022, 11:24 PM@task
annotation, right?
Or is there anything else?Kevin Kho
04/21/2022, 11:24 PMAssaf Ben Shimon
04/21/2022, 11:28 PMKevin Kho
04/21/2022, 11:28 PMAssaf Ben Shimon
04/21/2022, 11:29 PMKevin Kho
04/21/2022, 11:29 PM