Member-only story
#68 Airflow (part 2): DAG, provider & operator/How to write your very first static DAG file.
Basic concepts
DAG
A directed acyclic graph (DAG) is a conceptual representation of a series of activities. The order of the activities is depicted by a graph, which is visually presented as a set of circles, each one representing an activity, some of which are connected by lines, which represent the flow from one activity to another. Each circle is known as a “vertex” and each line is known as an “edge.” “Directed” means that each edge has a defined direction, so each edge necessarily represents a single directional flow from one vertex to another. “Acyclic” means that there are no loops (i.e., “cycles”) in the graph, so that for any given vertex, if you follow an edge that connects that vertex to another, there is no path in the graph to get back to that initial vertex.
Simply put, to understand DAG, you need to be aware of 3 matters:
- Directed: Meaning that each task is connected with each other by one-way arrow line. From T1 you can execute T2 and T3 but from T2, T3 you can not go back to T1.
- Acyclic: That is, it consists of vertices and edges, with each edge directed from one vertex to another, such that following those directions will never form a closed loop.