Airflow Part 2 - DAGs

Data Engineering
MLOps
Airflow
Author

Imad Dabbura

Published

January 17, 2022

Note

Other than my experience and the documentation, the main resource behind this post and figures is the fantastic book: Data Pipelines with Apache. Airflow.

import airflow
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator

f = lambda: print(1)
dag = DAG(dag_id="simple-workflow", start_date=airflow.utils.dates.days_ago(10))
a = BashOperator(task_id="bash", bash_command="echo 'a'", dag=dag)
b = PythonOperator(task_id="python", python_callable=f, dag=dag)
a >> b
<Task(PythonOperator): python>