Sharadh commented on issue #6317: [AIRFLOW-5644] Simplify TriggerDagRunOperator 
usage
URL: https://github.com/apache/airflow/pull/6317#issuecomment-596693351
 
 
   Thanks for the quick reply @BasPH, and especially for taking the time to 
sketch out the workaround / new style.
   
   That does clarify - I'm assuming that `_should_trigger` in your example 
above can modify `dag_run.conf` to perhaps add more inputs in. That would 
replicate what we currently do with `TriggerDagRunOperator`. For example, a 
really trivial case would be:
   
   ```py
   def _should_trigger(dag_run, **_):
       if not dag_run.conf["should_trigger"]:
           raise AirflowSkipException("should_trigger set to False")
       dag_run.conf["downstream_payload"]["trigger_checked_at"] = datetime.now()
   ```
   
   I do also appreciate - from a design perspective - that the code now is 
simpler; I daresay it's cleaner for us to separate out the logic of if / how to 
trigger (which is purely business logic), from the trigger itself (which is 
purely an airflow construct). I guess the old code was conflating a bit of 
`PythonOperator` concerns with `TriggerDagRunOperator` concerns.
   
   Is there some sort of release notes for the new `TriggerDagRunOperator` 
changes? I'd like to contribute to clarify what functionality has changed, and 
codify the workaround you're suggesting here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to