GitHub user rodigu edited a discussion: Get output of chosen branch

How can I use the output of a task chosen by a branch as the input parameter 
for a different task?

I have the following as a simplified example of the DAG structure I want to 
implement:

```py
@task
def pick_random_float() -> float: ...

@task.branch
def should_do_a_or_b(n: float):
    if n > 0.5:
        return "a"
    return "b"

@task
def a() -> int: ...

@task
def b() -> int: ...

@task
def final_task(number: int): ...

(
    should_do_a_or_b(pick_random_float())
    >> [a(), b()]
    >> final_task(OUTPUT_OF_CHOSEN_TASK_BRANCH)
)
```

Thanks,
rodigu

GitHub link: https://github.com/apache/airflow/discussions/52593

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to