You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating a DAG, in which I want to include a branching task.
The branching task will select tasks that should receive data through their parameters.
Here is a simplification:
@dagdefbranching_dag():
@task.branch(task_id='branching_task')defchoose_task(do_a: bool):
ifdo_a:
return"do_a"return"do_b"@taskdefa(text: str):
print(text)
defb(text: str):
print(f'{text} but in b')
choose_task(True)
How can I pass data to a or b?
I have read on Airflow XComs, but the documentation seems a little unclear. Is task_instance a variable that is always available? How should I import or access it using the TaskFlow API?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am creating a DAG, in which I want to include a branching task.
The branching task will select tasks that should receive data through their parameters.
Here is a simplification:
How can I pass data to
a
orb
?I have read on Airflow XComs, but the documentation seems a little unclear. Is
task_instance
a variable that is always available? How should I import or access it using the TaskFlow API?Beta Was this translation helpful? Give feedback.
All reactions