Skip to content

Decouple dag.test from importing from airflow-core #61803

Open
0 of 2 issues completed
Open

Description

@amoghrajesh

Body

dag.test today needs airflow-core to work, this should be gone for client server separation: https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/definitions/dag.py#L1147-L1376

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added this to the Airflow 3.3.0 milestone on Feb 12, 2026
  2. added
    kind:meta
    on Feb 12, 2026
  3. shnhdan commented on Mar 5, 2026

    @shnhdan

    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 .

  4. potiuk commented on Mar 10, 2026

    @potiuk
    Member

    Just start if you want. If you will have good pr - submit it.

  5. junyeong0619 commented on May 7, 2026

    @junyeong0619
    Contributor

    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):

    1. airflow.utils.session.create_session (L1473) — sub-issue Remove airflow.utils.session references in task-sdk #54710
    2. airflow.serialization.serialized_objects.create_scheduler_operator (L1484)

    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.

    Does this direction look acceptable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:featurekind:meta

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions