victorymakes opened a new pull request, #69442:
URL: https://github.com/apache/airflow/pull/69442
## Summary
`DatabricksSubmitRunOperator` and `DatabricksRunNowOperator` both implement
`on_kill()` to cancel the Databricks run when an Airflow task is killed
(SIGTERM or `execution_timeout`). `DatabricksTaskBaseOperator` — the base for
`DatabricksTaskOperator` and `DatabricksNotebookOperator` — is missing the same
implementation, so Databricks jobs continue running after the Airflow task is
killed, orphaning compute resources and incurring unnecessary cloud spend.
`DatabricksWorkflowTaskGroup` received `on_kill()` in #42115; this PR closes
the remaining gap for standalone task operators.
## Changes
- Adds `on_kill()` to `DatabricksTaskBaseOperator` using
`self.databricks_run_id`, which is:
- initialised to `None` in `__init__` (no `AttributeError` risk)
- set by `_launch_job()` the moment the run is submitted — earlier than
any polling or permission calls
- Adds unit tests covering both the cancel and no-op paths
## Testing
```
pytest
providers/databricks/tests/unit/databricks/operators/test_databricks.py -k
"on_kill"
```
##### Was generative AI tooling used to co-author this PR?
- [x] Yes — Claude Code (Sonnet 4.6)
--
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]