Skip to content

Fall back when a task cannot be expanded - #49772

Merged
uranusjr merged 2 commits into
apache:mainfrom
astronomer:api-not-crash-for-unexpanded
Apr 26, 2025
Merged

uranusjr merged 2 commits into
apache:mainfrom
astronomer:api-not-crash-for-unexpanded

Conversation

@uranusjr

Copy link
Copy Markdown
Member

When rendering a dag in the API, we must take account for cases when a mapped task cannot be expanded, either due to the upstream has not been resolved, or cannot provide a value due to failure.

When this happens, we simply count 1 ti for the unexpanded task. This is how the scheduler represent the task internally, and should be a good enough value for UI representation.

Close #48786.

@phanikumv phanikumv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI failures to be fixed

@tirkarthi

Copy link
Copy Markdown
Contributor

Test failures seem to be unrelated. Maybe update the branch with main to give it a try?

When rendering a dag in the API, we must take account for cases when a
mapped task cannot be expanded, either due to the upstream has not been
resolved, or cannot provide a value due to failure.

When this happens, we simply count 1 ti for the unexpanded task. This is
how the scheduler represent the task internally, and should be a good
enough value for UI representation.
@uranusjr
uranusjr force-pushed the api-not-crash-for-unexpanded branch from ccbd65a to 4d6de80 Compare April 26, 2025 01:28
@uranusjr

Copy link
Copy Markdown
Member Author

Looks like the docker compose thing is failing everywhere. I’ll ignore it.

@uranusjr
uranusjr merged commit 19122e7 into apache:main Apr 26, 2025
@uranusjr
uranusjr deleted the api-not-crash-for-unexpanded branch April 26, 2025 07:46
kaxil pushed a commit that referenced this pull request Apr 26, 2025
@kaxil kaxil added this to the Airflow 3.0.1 milestone Apr 26, 2025

@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.

Great, thanks @uranusjr!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid view stops loading when there is a pending task to be expanded

5 participants