You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Alwaysgaurav1 (via GitHub)" <gi...@apache.org> on 2026/07/06 06:34:58 UTC
[PR] fix(task-sdk): raise exception on Variable.set and Variable.delete failures [airflow]
Alwaysgaurav1 opened a new pull request, #69436:
URL: https://github.com/apache/airflow/pull/69436
### Description
Currently, in the Task SDK, `Variable.set()` and `Variable.delete()` route their requests through the supervisor Execution API, but they do not check if the response is an `ErrorResponse`. If the API rejects the write operation (for example, returning a 403 Forbidden due to per-task authorization policies), the error is silently swallowed, and the task reports a `success` status even though the variable was not modified/deleted.
This PR fixes that by:
- Checking the supervisor response type inside `_set_variable` and `_delete_variable` in `airflow/sdk/execution_time/context.py`.
- Raising an `AirflowRuntimeError` if the response is an `ErrorResponse`.
- Adding unit tests in `task-sdk/tests/task_sdk/definitions/test_variables.py` to ensure that `Variable.set()` and `Variable.delete()` correctly raise `AirflowRuntimeError` when the Execution API returns an error response.
Closes: #68537
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(task-sdk): raise exception on Variable.set and Variable.delete failures [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #69436: fix(task-sdk): raise exception on Variable.set and Variable.delete failures
URL: https://github.com/apache/airflow/pull/69436
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org