Introduction to Apache Airflow in Python
Mike Metzger
Data Engineer
DAG, or Directed Acyclic Graph:
Within Airflow, DAGs:
Example DAG:
from airflow import DAG
from datetime import datetime default_arguments = { 'owner': 'jdoe', 'email': '[email protected]', 'start_date': datetime(2020, 1, 20) }
with DAG('etl_workflow', default_args=default_arguments ) as etl_dag:
Example DAG:
from airflow import DAG
from datetime import datetime default_arguments = { 'owner': 'jdoe', 'email': '[email protected]', 'start_date': datetime(2020, 1, 20) }
etl_dag = DAG('etl_workflow', default_args=default_arguments )
Using airflow
:
airflow
command line program contains many subcommands.airflow -h
for descriptions.airflow dags list
to show all recognized DAGs.Use the command line tool to:
Use Python to:
Introduction to Apache Airflow in Python