From the course: Apache Airflow Essential Training
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Passing multiple outputs in TaskFlow - Apache Airflow Tutorial
From the course: Apache Airflow Essential Training
Passing multiple outputs in TaskFlow
- [Instructor] Here I am back in my code. And let me show you how you can fix tasks that send multiple outputs, such that the individual outputs can be accessed outside of the task. I'm going to update the decorator that I applied to this compute total and average function. So that the @task decorator specifies a parameter. The @task decorator supports many configuration parameters, such as the task id, that's one. But it also supports multiple outputs that is a Boolean parameter. Setting multiple outputs to true indicates to Airflow that this task produces multiple outputs, that should be accessible outside of the task. Now what I return here on line 45 remains the same. I only return the dictionary. Now here I still have the same code as before. Observe how I invoke display result. I access price summary data and look up the values corresponding to the keys "total_price" and "average_price." This is what was not…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Prerequisites39s
-
(Locked)
Quick Airflow setup overview3m 27s
-
(Locked)
DAG using PythonOperators3m 33s
-
(Locked)
DAG using TaskFlow3m 55s
-
(Locked)
Passing data using XCom with operators5m 37s
-
(Locked)
Passing data using the TaskFlow API4m 41s
-
(Locked)
Tasks with multiple outputs5m 40s
-
(Locked)
Passing multiple outputs in TaskFlow1m 47s
-
-
-
-
-
-