TriggerDagRunOperator and ExternalTaskSensor with dynamic execution_date #36252
Unanswered
prithvi-git
asked this question in
Q&A
Replies: 1 comment 8 replies
-
Hi @prithvi-git, IIUC your main problem that the "prod_to_demo_sensor" task doesn't properly find the DAG run that's triggered by the "prod_to_demo"? If so, you could always have the "prod_to_demo" task continue to run until the triggered DAG is completed by setting |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to trigger one dag multiple times with different configs using TriggerDagRunOperator and ExternalTaskSensor. However, TriggerDagRunOperator takes parent DAGs execution_date (logical_date) for execution and that just reruns same instance of triggered DAG instead of running new instance with new config. Sample code below.
Tried passing execution_date if different ways to TriggerDagRunOperator and ExternalTaskSensor but no luck.
I'm expecting a solution so I can trigger same DAG with different config.
DAG - exec_master
@task_group(group_id='refresh_pre-prod')
def refresh_pre_prod():
prod_to_pre_prod = TriggerDagRunOperator (
task_id='prod_to_pre_prod',
trigger_dag_id="util_clone_bq_env",
execution_date='{{ dag_run.logical_date }}',
conf={"src_project_id":"production",
"trg_project_id":"pre-production"},
reset_dag_run = True)
refresh_pre_prod() >> bq_refresh_demo()
Thanks,
Prithvi.
Beta Was this translation helpful? Give feedback.
All reactions