guan404ming commented on code in PR #71073:
URL: https://github.com/apache/airflow/pull/71073#discussion_r3754742803


##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py:
##########
@@ -133,7 +143,13 @@ def execute(self, context: Context) -> str | Iterable[str] 
| None:
 
     def execute_complete(self, context: Context, generated_output: str, event: 
dict[str, Any]) -> Any:
         """Resume after human review, validating the reviewed choice before 
branching."""
-        output = super().execute_complete(context, generated_output, event)
+        try:
+            output = super().execute_complete(context, generated_output, event)
+        except HITLRejectException:
+            if self.fail_on_reject:
+                raise
+            self.log.info("Rejected. Skipping all downstream tasks...")
+            return self.do_branch(context, None)

Review Comment:
   Good catch. Now filters teardowns like `ApprovalOperator` and updated the 
docs wording accordingly.



-- 
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