airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Deadline callback context has no prev_*_success keys

Open seanghaeli opened this issue 3 weeks ago • 3 comments

The context a deadline callback gets (#75363) is built from the Dag run, not a task instance, so it has no prev_data_interval_start_success, prev_data_interval_end_success, prev_start_date_success or prev_end_date_success. The Execution API only looks these up by task instance, so callbacks would need an equivalent lookup by Dag run.

seanghaeli avatar Nov 10 '26 07:11 seanghaeli

I'd like to work on this. Initial local inspection shows that the Execution API already has GET /dag-runs/previous with state=success; its Dag run response contains all four dates. I'll reuse that lookup for the synchronous callback path, check the equivalent query in the triggerer for asynchronous callbacks, and add the four context keys with focused tests (including no logical date and no previous success). I'm checking the local setup before making changes and will update this issue if the approach changes.

mote24405-coder avatar Nov 11 '26 06:11 mote24405-coder

Go for it!

seanghaeli avatar Nov 12 '26 00:11 seanghaeli

Quick update: I’ve pushed a fix that adds the four prev_*_success context keys to both synchronous and asynchronous deadline callbacks. The targeted Breeze tests passed locally (62 Task SDK tests and 5 Triggerer tests).

View the changes

This branch is based on #75363. Once that PR lands, I’ll rebase onto main and open a follow-up PR.


Drafted-by: Codex (GPT-6.1 Sol); reviewed by @mote24405-coder before posting

mote24405-coder avatar Nov 13 '26 07:11 mote24405-coder