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


##########
providers/anthropic/src/airflow/providers/anthropic/hooks/anthropic.py:
##########
@@ -149,6 +150,29 @@ def evaluate_session_state(
     return False, None, False
 
 
+#: Statuses the provider's triggers emit in their terminal event.
+TRIGGER_EVENT_STATUSES = frozenset({"success", "error", "timeout"})
+
+
+def validate_execute_complete_event(event: dict[str, Any] | None = None) -> 
dict[str, Any]:
+    """
+    Validate the event a deferred task resumes with, returning it if 
well-formed.
+
+    The event crosses the triggerer/worker boundary through the metadata DB, 
so a
+    resuming task can receive ``None`` or a status its handlers do not 
recognise
+    (version skew, a custom trigger). Both must fail loudly: the 
``execute_complete``
+    handlers raise on ``timeout``/``error`` and treat everything else as 
success, so
+    an unrecognised status would otherwise silently succeed.

Review Comment:
   ```suggestion
       an unrecognized status would otherwise silently succeed.
   ```



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