Uh oh!
There was an error while loading. Please reload this page.
fix(task-sdk): add greenback fallback for Variable access in triggerer - #63387
Conversation
e6164e1 to
9c34355Compared5e75ba to
a1323e5Comparea1323e5 to
1b12d6bCompare1b12d6b to
d7a1109Compare0c37a69 to
d7f004aCompareThere was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the missing greenback fallback path to ExecutionAPISecretsBackend.get_variable() so triggerer usage of Variable.get() doesn’t incorrectly return None when SUPERVISOR_COMMS.send() hits the async_to_syncRuntimeError in an async event loop.
Changes:
- Add
RuntimeErrordetection + greenback portal fallback toget_variable()(mirroringget_connection()behavior). - Add a unit test covering the new fallback path for variable access.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| task-sdk/src/airflow/sdk/execution_time/secrets/execution_api.py | Adds greenback portal detection + async fallback for get_variable() when async_to_sync fails in triggerer contexts. |
| task-sdk/tests/task_sdk/execution_time/test_secrets.py | Adds a regression test ensuring get_variable() uses the greenback fallback when SUPERVISOR_COMMS.send() raises the known RuntimeError. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a01808a to
8008073Compare8008073 to
ed828f4CompareUh oh!
There was an error while loading. Please reload this page.
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
ExecutionAPISecretsBackend.get_variable()is missing theRuntimeError+ greenback fallback thatget_connection()already has (added in #57154). When a deferrable operator's trigger callsVariable.get()inside the triggerer's async event loop,SUPERVISOR_COMMS.send()raisesRuntimeErrorfromasync_to_sync. The bareexcept Exceptionswallows it and returnsNone, so every backend returns nothing and the variable is reported as not found.Added the same greenback portal detection and
aget_variable()fallback thatget_connection()uses. Added a matching unit test.Closes: #61676
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4, claude-opus-4-6) following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.