Files
airflow/shared/secrets_backend
D. Ferruzzi 2c9088e078 Allow Variable.get to reuse the caller's database session (#71968)
`MetastoreBackend.get_variable` is decorated with `@provide_session`. Called
without a session it goes through `create_session()`, which for a scoped session
returns *the caller's own session* and commits it on exit. So any code that reads
a Variable while holding a transaction gets that transaction committed underneath
it — detaching its objects, or raising `UNEXPECTED COMMIT` under the scheduler's
`prohibit_commit` guard, where the error is then swallowed per-backend and
surfaces as a missing Variable.

`Variable.get` and `Variable.get_variable_from_secrets` now take an optional
keyword-only `session`, forwarded only to `MetastoreBackend`. `Variable.update`
forwards its own.
2026-09-14 12:54:11 -04:00
..