seanghaeli opened a new pull request, #75363:
URL: https://github.com/apache/airflow/pull/75363

   Deadline callbacks get a Dag run snapshot that the scheduler stores in their 
kwargs when the deadline is missed, and Airflow never renders their kwargs, so 
`{{ dag_run.run_id }}` reaches the callback as raw text. This replaces #64984 
and, as suggested there, stops storing the context and builds it where the 
callback runs: the triggerer sends the Dag run with the trigger workload like 
it does for `start_from_trigger` tasks, and the executor callback subprocess 
fetches it over the Execution API with the token from #71192. Both paths then 
render string kwargs with Airflow's template environment through one shared 
helper, and a template that fails to render is passed on unrendered with a 
warning in the callback log. `context["dag_run"]` is now a Dag run object like 
in a task's context instead of a dict, so I called that out in a significant 
newsfragment. I tested it in Breeze with an `AsyncCallback` and a 
`SyncCallback` whose kwargs use `{{ dag_run.run_id }}`, `{{ ds }}`, `{{ logical_
 date | ds_nodash }}`, `{{ deadline.deadline_time }}` and a typo'd filter, read 
back from the UI callback log endpoint:
   
   ```
   before: DEADLINE_PROBE_SYNC>>> text='run_id={{ dag_run.run_id }} ds={{ ds }} 
ds_nodash={{ logical_date | ds_nodash }} deadline={{ deadline.deadline_time }} 
...
   after:  DEADLINE_PROBE_ASYNC>>> 
text='run_id=manual__2026-10-21T17:28:54.584244+00:00 ds=2026-10-01 
ds_nodash=20261001 deadline=2026-10-21T17:29:16.131028+00:00 ...
   after:  DEADLINE_PROBE_SYNC>>> 
text='run_id=manual__2026-10-21T17:29:10.768507+00:00 ds=2026-10-01 
ds_nodash=20261001 deadline=2026-10-21T17:29:32.331914+00:00 ...
   after:  [warning] Could not render the template in callback kwarg 'bad', 
passing it unrendered: TemplateAssertionError: No filter named 'no_such_filter'.
   ```
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Opus 5.5) 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]

Reply via email to