You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/17 09:41:50 UTC
[GitHub] [airflow] huf-92 commented on issue #17343: Dags added by DagBag interrupt randomly
huf-92 commented on issue #17343:
URL: https://github.com/apache/airflow/issues/17343#issuecomment-900149194
Thank you for your fast reply.
Removing <code>trigger.execute({})</code> causes that the self-triggering process is not starting. Perhaps i described my self-triggering process in a bad way. Below you see the TriggerDagRunOperator is wrapped by a function called by a PythonOperator
and therefore the trigger.execute({}) is needed. Or is there a better way to trigger the same DAG in function called by an operator ?
```python
trigger_dag = PythonOperator(
task_id="trigger_dag",
python_callable=_trigger_dag,
)
trigger_dag.doc_md = """triggers a new dag"""
def _trigger_dag():
if random_condition:
trigger = TriggerDagRunOperator(
task_id="trigger",
trigger_dag_id=dag_name,
conf={"group_nr": next_group_nr, "group": next_group},
)
trigger.execute({})
else:
return
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org