what does the >> operator do in an Airflow DAG ?

it defines downstream steps or step sequencing.

https://stackoverflow.com/questions/52389105/how-operator-defines-task-dependencies-in-airflow

In the example below, dbt_run then dot_test

from datetime import timedelta
from airflow import DAGfrom airflow.operators.bash_operator import BashOperatorfrom airflow.utils.dates import datetimefrom airflow.utils.dates import timedelta

with DAG(dag_id='dbt_dag',start_date=datetime(2021, 12, 23),description='An Airflow DAG to invoke simple dbt commands',schedule_interval=timedelta(days=1),) as dag:

dbt_run = BashOperator(
    task_id='dbt_run',
    bash_command='dbt run'
)

dbt_test = BashOperator(
    task_id='dbt_test',
    bash_command='dbt test'
)

dbt_run >> dbt_test

Leave a Comment

Your email address will not be published. Required fields are marked *