zlacker

[parent] [thread] 0 comments
1. rubenf+(OP)[view] [source] 2023-05-13 07:22:31
That's because you're looking at the TaskFlow syntax and a trivial example of passing all the results from a Task A as all the inputs of a Task B that follows it immediately. TaskFlow works mostly in trivial case. The true syntax for it is in the tab "Traditional syntax". For a complex graph where you're passing data from step A to a node that is far down the tree and deeply nested and you will see that it's quite cumbersome. Even in their trivial example:

    res = requests.get(url)
    ti.xcom_push(key="cat_fact", value=json.loads(res.text)["fact"])

    ...
  
    cat_fact = ti.xcom_pull(key="cat_fact", task_ids="get_a_cat_fact")
[go to top]