Sébastien12/09/2020, 11:46 AM
to manually create a dependency, but that gives me:
What's the right way to say (in functional API) that task2 can only run after task1 was completed, without messing up the flow? The entire flow:
/usr/local/lib/python3.7/dist-packages/prefect/core/task.py:596: UserWarning: You are making a copy of a task that has dependencies on or to other tasks in the active flow context. The copy will not retain those dependencies.
schedule = CronSchedule("0 * * * *", start_date=datetime.now()) with Flow("Q", schedule=schedule) as flow: task2.set_upstream(task1) task1() some_result = task2() task3(some_result)
josh12/09/2020, 1:56 PM
with Flow("Q", schedule=schedule) as flow: task_1 = task1() some_result = task2() some_result.set_upstream(task_1) task3(some_result)
Sébastien12/09/2020, 1:57 PM
rather than the result of a task?
josh12/09/2020, 1:59 PM
with Flow("Q", schedule=schedule) as flow: task_1 = task1() task_2 = task2() task_2.set_upstream(task_1) task3(task_2)
is a shorthand way of passing the result of task2 into task3 (and thus making is an upstream task). Calling
is setting the upstream directly without passing any data.
Sébastien12/09/2020, 2:01 PM
, which is
josh12/09/2020, 2:03 PM
Sébastien12/09/2020, 2:04 PM