Skip to content

Keep the Dag asset schedule the same shape for every caller - #73805

Merged
henry3260 merged 1 commit into
apache:mainfrom
henry3260:fix-asset-schedule-count-caller-scoped
Oct 5, 2026
Merged

henry3260 merged 1 commit into
apache:mainfrom
henry3260:fix-asset-schedule-count-caller-scoped

Conversation

@henry3260

@henry3260 henry3260 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

closes: #73803

Stacked on #72862 — that PR's commit is included in this branch's diff; only the second commit belongs to this change.

Why

#72862 scopes GET /ui/next_run_assets/{dag_id} so events carries only the assets the caller may read, while asset_expression keeps a hidden slot for each unreadable one (#72864). AssetSchedule.tsx still derives both the total and its layout from events, so the Dag renders differently depending on who is looking at it.

For a Dag scheduled on assets A, B and C, a caller who may read only A sees:

  • "0 of 1" instead of "0 of 3" — scheduledTotal is nextRunEvents.length.
  • The single-asset layout instead of the popover, from the nextRunEvents.length === 1 branch.
  • No asset schedule at all if none are readable — the !nextRunEvents.length branch falls back to timetableSummary, hiding that the Dag is asset triggered.

The popover contents are already correct: AssetExpression renders the hidden slots.

What

  • NextRunAssetsResponse gains scheduling_asset_count: how many assets the Dag is scheduled on, counted before the readable filter narrows the query. It reveals nothing new — the redacted expression already carries one slot per asset.
  • AssetSchedule.tsx uses it for scheduledTotal and for the two length-based branches. scheduledCount is unchanged: only readable, satisfied assets count as ready.

The count costs one extra query on an endpoint that renders once per Dag card, so assert_queries_count goes from 5 to 6. An alternative that avoids it — filtering unreadable rows in Python instead of SQL, taking the total from the unfiltered row count — would mean reworking #72862's approach; happy to switch if reviewers prefer that trade.


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

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Sep 27, 2026

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment. Remove.

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment lgtm otherwise.

Need rebase.

Comment thread airflow-core/src/airflow/ui/src/pages/DagsList/AssetSchedule.tsx Outdated
next_run_assets returns only the assets the caller may read, so a UI
deriving the schedule from that list renders a different Dag depending on
who is looking at it: a smaller total, the single-asset layout instead of
the popover, or no asset schedule at all when none of the assets are
readable.
@henry3260
henry3260 force-pushed the fix-asset-schedule-count-caller-scoped branch from ed1bc99 to b4e6468 Compare October 5, 2026 16:17
@henry3260
henry3260 marked this pull request as ready for review October 5, 2026 17:28
@henry3260
henry3260 merged commit 1ab53cd into apache:main Oct 5, 2026
100 of 101 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: asset schedule count and layout depend on which assets the caller may read

2 participants