Skip to content

[v3-2-test] UI: Serve grid TI summaries from shared cached DagBag (#65775)#65966

Merged
pierrejeambrun merged 1 commit into
apache:v3-2-testfrom
astronomer:backport-65775
Apr 28, 2026
Merged

[v3-2-test] UI: Serve grid TI summaries from shared cached DagBag (#65775)#65966
pierrejeambrun merged 1 commit into
apache:v3-2-testfrom
astronomer:backport-65775

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

Backport of #65775 to v3-2-test.

Cherry-picked from be41cb4.

Conflict in airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:

  • v3-2-test still uses the simpler _build_ti_summaries shape (collections.defaultdict(list) + _get_aggs_for_node, returning dict) — kept that, just switched the DAG lookup to the shared DBDagBag.
  • v3-2-test's DBDagBag does not yet expose a public get_dag(version_id, session) (added on main alongside the LRU/TTL cache). Used _get_dag(...) instead, matching how airflow.api_fastapi.common.dagbag.get_dag_for_run_or_latest_version already calls it on this branch.
  • Narrowed the dag_version_id parameter to UUID | None in _get_serdag to match v3-2-test's DBDagBag._get_dag signature (mypy caught this).
  • v3-2-test's _find_aggregates yields plain dicts (not (node, _) tuples), so kept for node in _find_aggregates(...).
  • Dropped the per-request serdag_cache: dict = {} in get_grid_ti_summaries_stream — the shared DBDagBag instance attached to app.state already deduplicates across runs and across requests.

Generated files (_private_ui.yaml, the openapi-gen *.ts) auto-merged cleanly.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

The grid TI summaries streaming endpoint used a per-request dict to
dedupe serialized Dag loads within a single response. Switch to the
app-wide DBDagBag so the serialized Dag is cached across requests (via
the LRU+TTL configured by [api] dag_cache_size / dag_cache_ttl) and
the in-memory representation is the lightweight SerializedDAG instead
of the SerializedDagModel ORM row holding the full JSON blob.

(cherry picked from commit be41cb4)
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Apr 27, 2026
@pierrejeambrun pierrejeambrun merged commit 7249b6c into apache:v3-2-test Apr 28, 2026
110 checks passed
@pierrejeambrun pierrejeambrun deleted the backport-65775 branch April 28, 2026 07:58
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
@vatsrahul1001 vatsrahul1001 added the type:misc/internal Changelog: Misc changes that should appear in change log label May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
The grid TI summaries streaming endpoint used a per-request dict to
dedupe serialized Dag loads within a single response. Switch to the
app-wide DBDagBag so the serialized Dag is cached across requests (via
the LRU+TTL configured by [api] dag_cache_size / dag_cache_ttl) and
the in-memory representation is the lightweight SerializedDAG instead
of the SerializedDagModel ORM row holding the full JSON blob.

(cherry picked from commit be41cb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. type:misc/internal Changelog: Misc changes that should appear in change log

3 participants