fix(task-sdk): raise exception on Variable.set and Variable.delete failures#69436
Closed
Alwaysgaurav1 wants to merge 1 commit into
Closed
fix(task-sdk): raise exception on Variable.set and Variable.delete failures#69436Alwaysgaurav1 wants to merge 1 commit into
Alwaysgaurav1 wants to merge 1 commit into
Conversation
Alwaysgaurav1
force-pushed
the
fix/68537-task-sdk-variable-write-errors
branch
from
July 6, 2026 06:38
b6fc59c to
d0a0c03
Compare
Alwaysgaurav1
force-pushed
the
fix/68537-task-sdk-variable-write-errors
branch
from
July 9, 2026 05:28
d0a0c03 to
c8761d0
Compare
amoghrajesh
reviewed
Jul 9, 2026
amoghrajesh
left a comment
Contributor
There was a problem hiding this comment.
Doesn't it seem to be a duplicate/rework of: #68542
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, in the Task SDK,
Variable.set()andVariable.delete()route their requests through the supervisor Execution API, but they do not check if the response is anErrorResponse. 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 asuccessstatus even though the variable was not modified/deleted.This PR fixes that by:
_set_variableand_delete_variableinairflow/sdk/execution_time/context.py.AirflowRuntimeErrorif the response is anErrorResponse.task-sdk/tests/task_sdk/definitions/test_variables.pyto ensure thatVariable.set()andVariable.delete()correctly raiseAirflowRuntimeErrorwhen the Execution API returns an error response.Closes: #68537