shahar1 commented on code in PR #75968:
URL: https://github.com/apache/airflow/pull/75968#discussion_r4493878818


##########
providers/google/src/airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py:
##########
@@ -203,6 +211,7 @@ def __init__(
         impersonation_chain: str | Sequence[str] | None = None,
         deferrable: bool = conf.getboolean("operators", "default_deferrable", 
fallback=False),
         poll_interval: int = 10,
+        fail_on_empty_predictions: bool = True,

Review Comment:
   **minor**: this behaviour change needs a changelog note.
   
   `providers/AGENTS.md`:
   
   > When a provider change needs a user-visible note (typically a breaking 
change or important behavior change that warrants explanation), update the 
provider's `docs/changelog.rst` directly in the same PR, just below the 
`Changelog` header — exactly as the in-file `NOTE TO CONTRIBUTORS` block 
describes.
   
   With `True` as the default, tasks that succeed today start failing after the 
upgrade, and with `retries` set, each retry submits a new job. The changelog is 
where users would learn about the opt-out. Something like:
   
   ```rst
   .. note::
   
       ``CreateBatchPredictionJobOperator`` now fails the task when Vertex AI 
reports a batch
       prediction job as succeeded but every input row failed. Set
       ``fail_on_empty_predictions=False`` to keep the previous behavior.
   ```
   
   The `22.8.0` section has a similar note for the `cancel_on_kill` default.



##########
providers/google/src/airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py:
##########
@@ -312,6 +343,13 @@ def execute_complete(self, context: Context, event: 
dict[str, Any]) -> dict[str,
             raise AirflowException(event["message"])
         job: dict[str, Any] = event["job"]
         self.log.info("Batch prediction job %s created and completed 
successfully.", job["name"])

Review Comment:
   **nit**: this logs "created and completed successfully" right before 
`_check_completion_stats` can fail the task, so a failed task's log reports 
success just above the error. Moving this line below the check fixes 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