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


##########
providers/common/ai/src/airflow/providers/common/ai/batch/polling.py:
##########
@@ -126,11 +137,14 @@ def finish_timeout(self, *, cancelled: bool, 
cancel_error: str | None = None) ->
         Build the final ``timeout`` event once the caller has (not) cancelled 
the batch.
 
         The message names the budget, the deadline, and what happened to the
-        batch, so an on-call reader can tell "cancelled, a retry resubmits"
+        batch, so an on-call reader can tell "cancelled, a retry lands what 
finished"
         from "still running and billing, a retry re-attaches".
         """
         if self.cancel_on_timeout and cancelled:
-            fate = "The batch was cancelled (cancel_on_timeout=True); a retry 
submits a new one."
+            fate = (
+                "The batch was cancelled (cancel_on_timeout=True); a retry 
re-attaches and lands "

Review Comment:
   Yes, the message was wrong. It now says the retry re-attaches and lands what 
finished, then fails with `LLMBatchCancelledError` if any request was 
cancelled, and the attempt after that submits a new batch.



##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_batch.py:
##########
@@ -367,6 +383,12 @@ def execute(self, context: Context) -> dict[str, Any]:
                 output_schema_digest=output_schema_digest,
                 intent_at=intent_at,
             )
+            if self.completion_window != _DEFAULT_COMPLETION_WINDOW and 
adapter_name != "openai":

Review Comment:
   Done: `BatchAdapter.supports_completion_window` (default `True`, so 
third-party adapters are untouched), `False` on the pydantic-ai adapters, and 
the operator warns only when the adapter says it can't honour it.



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