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.
DAG using PythonOperators - Apache Airflow Tutorial
From the course: Apache Airflow Essential Training
DAG using PythonOperators
- [Instructor] In this demo, we'll see how you can work with the TaskFlow API in Apache Airflow. The TaskFlow API is new in version 2.0 of Apache Airflow and it makes it simpler for you to write your DAGs using Python code rather than operators, so you eliminate a lot of boilerplate that's associated with operators. Now, before we look at the TaskFlow API, let's take a look at a very simple Python DAG that uses operators and then, we'll switch this DAG over to use the TaskFlow API. I already have the code set up here. Observe the import on line eight, importing the PythonOperator. This is what we'll use to invoke python_callables in our code. I've set up the default arguments for my DAG. I have owner set to loonycorn and then, I've defined a bunch of very simple tasks where each task is a Python function. I have five different Python tasks here, task A through task E, and each of these tasks simply prints out a…
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
-
-
-
-
-
-