seanghaeli opened a new pull request, #66608: URL: https://github.com/apache/airflow/pull/66608
## Summary Replace the simple context workaround from #55241 that stored serialized context in trigger kwargs (DB). Now that #55068 gives the triggerer API access, fetch the DagRun at execution time via the Execution API and build context fresh. This avoids DB bloat from serialized context, provides fresh (not stale) context, and builds a richer context dict including `logical_date`, `ds`, `ts`, `conf`, `data_interval_start/end`, and the deadline info. ## Changes - **`deadline.py`**: Remove `get_simple_context()`. Store only identifiers (`dag_id`, `run_id`, `deadline_id`, `deadline_time`) in callback kwargs. - **`callback.py`**: Add `_build_context()` that fetches DagRun via `SUPERVISOR_COMMS.asend(GetDagRun(...))`. Backward compat: old callbacks with `"context"` key still work. - **`triggerer_job_runner.py`**: Add `GetDagRun` to `ToTriggerSupervisor` union, `DagRunResult` to `ToTriggerRunner` union, handler in `_handle_request`. - **`callback_supervisor.py`**: Add `GetDagRun` to `CallbackToSupervisor` union + handler for executor callback path. - **Tests**: Updated deadline model tests, added context-fetching test, backward-compat test, `GetDagRun` handler test. ## Motivation Per @ramitkataria's feedback on #64984: context should not be stored in the DB. The triggerer now has API access (#55068), so fetch it at runtime like tasks do. ## Related - Addresses feedback from #64984 (closed) - Follows #55068 (triggerer API access) and reverts the context-storage approach from #55241 - Tracked on Asana AIP-86 Deadlines board --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.6) Generated-by: Claude Code (Opus 4.6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
