kaxil commented on code in PR #48747:
URL: https://github.com/apache/airflow/pull/48747#discussion_r2027308227


##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -304,8 +303,23 @@ def _trigger_dag_af_2(self, context, run_id, 
parsed_logical_date):
                     self.log.info("%s finished with allowed state %s", 
self.trigger_dag_id, state)
                     return
 
+    def execute_complete(self, context: Context, event: tuple[str, dict[str, 
Any]]):
+        if AIRFLOW_V_3_0_PLUS:
+            from airflow.exceptions import 
DagRunTriggerExecuteCompleteException
+
+            raise DagRunTriggerExecuteCompleteException(

Review Comment:
   Instead of an exception though, we should add a method `get_dagrun_state` on 
`RuntimeTaskInstance`. which will allow you to call it from task context.
   
   ```py
   context["ti"].get_dagrun_state(dag_id=self.trigger_dag_id, 
run_id=self.run_id)
   ```
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to