Last active
July 25, 2019 17:39
-
-
Save joffilyfe/73e577e63a537da09a2d9441d7b3f587 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import airflow | |
from airflow import DAG | |
from airflow.operators.dagrun_operator import TriggerDagRunOperator | |
def trigger_payload(context, dag_run_obj): | |
dag_run_obj.payload = {"issues": ["issue-1"]} | |
return dag_run_obj | |
# Define the DAG | |
dag = DAG( | |
dag_id='example_trigger_controller_dag', | |
default_args={ | |
"owner": "airflow", | |
"start_date": airflow.utils.dates.days_ago(2), | |
}, | |
schedule_interval='@once', | |
) | |
trigger = TriggerDagRunOperator( | |
task_id='test_trigger_dagrun', | |
trigger_dag_id="kernel_links", | |
python_callable=trigger_payload, | |
dag=dag, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment