You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decouple dag.test from importing from airflow-core #61803
I'd like to work on this - is it open for external contributors , or is it being handled internally ? Just wanted to know before I start looking into it .
I got interested in this issue and did some analysis. I'd like to propose a focused PR removing two airflow-core imports inside _run_task (task-sdk/src/airflow/sdk/definitions/dag.py):
Both are coupled: they exist only because _run_task does an ORM write (session.add(ti)) for the DEFERRED → SCHEDULED transition after inline trigger execution.
Proposal: move the DB-write responsibility from _run_task up to its caller (dag.test), which already has a session in scope. _run_task returns state-transition intent via TaskRunResult; the caller performs the write.
I'd keep the scope limited to _run_task and its single caller in dag.test.
Activity
airflow.utils.sessionreferences in task-sdk #54710airflow.utils.typesreferences in task-sdk #54713shnhdan commentedon Mar 5, 2026
I'd like to work on this - is it open for external contributors , or is it being handled internally ? Just wanted to know before I start looking into it .
potiuk commentedon Mar 10, 2026
Just start if you want. If you will have good pr - submit it.
Fix: Decouple Triggerer client and server via execution API (apache#6…
junyeong0619 commentedon May 7, 2026
Hi @amoghrajesh,
I got interested in this issue and did some analysis. I'd like to propose a focused PR removing two airflow-core imports inside _run_task (task-sdk/src/airflow/sdk/definitions/dag.py):
airflow.utils.sessionreferences in task-sdk #54710Both are coupled: they exist only because _run_task does an ORM write (session.add(ti)) for the DEFERRED → SCHEDULED transition after inline trigger execution.
Proposal: move the DB-write responsibility from _run_task up to its caller (dag.test), which already has a session in scope. _run_task returns state-transition intent via TaskRunResult; the caller performs the write.
I'd keep the scope limited to _run_task and its single caller in dag.test.
Does this direction look acceptable?
Drive a DagRun through a user-supplied custom executor
Drive a DagRun through a user-supplied custom executor (#230)