From the course: Data Engineering Pipeline Management with Apache Airflow

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Executing a simple branching DAG

Executing a simple branching DAG

- [Instructor] At this point, to understand what permissions each user has, it's important for us to create some DAGs that we can view and run. Having DAGs to play with will give us a better idea of the different kind of operations that each user can perform. Remember, every user has a different role. Now, here within my dags subfolder I have a simple_branching_with_variable.py file that contains a very simple branching DAG. Now, the DAG doesn't really do anything meaningful. It just prints stuff out to screen. Notice, I have a choose_branch Python function which accesses the variable choice and it chooses the branch based on the value of choice. I have a branch Python function that takes in a task instance. It pulls the value of choice from taskChoose. If choice is C, it executes taskC. If it's E, it'll execute taskE. And then, here is my DAG. The DAG ID is simple_branching_with_variable and you can see that it's…

Contents