Skip to content

Instantly share code, notes, and snippets.

@goodbyegangster
Created June 26, 2022 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goodbyegangster/57a95f37cb0bcac8f4a743206e382745 to your computer and use it in GitHub Desktop.
Save goodbyegangster/57a95f37cb0bcac8f4a743206e382745 to your computer and use it in GitHub Desktop.
A Sample TriggerDagRunOperator DAG
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.trigger_dagrun import TriggerDagRunOperator
with DAG(
dag_id='trigger_run_dag',
description='A Sample TriggerDagRunOperator DAG',
schedule_interval=timedelta(days=1),
start_date=datetime(2022, 6, 1),
catchup=False,
tags=['example'],
) as dag:
# class airflow.operators.trigger_dagrun.TriggerDagRunOperator
# https://github.com/apache/airflow/blob/main/airflow/operators/trigger_dagrun.py
trigger = TriggerDagRunOperator(
task_id='trigger',
trigger_dag_id='trigger_target_dag',
conf={'message': 'Mikochi'},
wait_for_completion=False,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment