shahar1 opened a new pull request, #67767: URL: https://github.com/apache/airflow/pull/67767
**This PR continues and replaces #62278 by @Ajay9704.** Ajay's branch has been rebased onto the current `main` and the two review concerns from that PR have been addressed in a new commit on top of his work. ## Summary When `CloudRunExecuteJobOperator` runs with `deferrable=True` and the underlying Cloud Run Job is cancelled (e.g. via the Google Cloud UI or API), the job's LRO completes _without_ setting `operation.error` — every remaining task ends up in `cancelled_count` rather than `failed_count`. The original deferrable path therefore silently returned success instead of raising an error, diverging from the non-deferrable behavior. The trigger (`CloudRunJobFinishedTrigger`) was already fixed in `main` to detect this by deserialising the `Execution` proto and comparing `succeeded_count + failed_count` against `task_count` (surfaced as a `FAIL` event). This PR adds a matching fallback check inside `execute_complete` and replaces the deprecated `AirflowException` with the appropriate Python built-in exceptions throughout `CloudRunExecuteJobOperator`. ### Changes - **`execute_complete`**: added a defensive task-count check that fails the operator if the trigger event carries `task_count`/`succeeded_count`/`failed_count` indicating an incomplete or partly-failed run. - **Exception clean-up**: replaced `AirflowException` (pending deprecation) with `RuntimeError` / `TimeoutError` in `CloudRunExecuteJobOperator` and other operators in the same file. - **Tests**: added unit tests for the cancelled-job and failed-tasks paths in `execute_complete`. - **Example file**: removed two placeholder documentation-only functions that had no runnable body (addressed review comment from #62278). closes: #57791 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (claude-sonnet-4-6) Generated-by: Claude Code (claude-sonnet-4-6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
