Pass try_number to extra links API - #65661
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
bbovenzi
left a comment
There was a problem hiding this comment.
Overall good, just a few quick comments.
bbovenzi
left a comment
There was a problem hiding this comment.
Switching to request so we don't accidentally merge.
…dation and immutability
fbfc4d0 to
94a0262
Compare
henry3260
left a comment
There was a problem hiding this comment.
Thanks for your PR! The logic looks great to me.
I have one minor optimization suggestion:
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
* Forward try_number to extra links API for correct retry links * Rename newsfragment to match PR number * Add tryNumber to generated OpenAPI query hooks * Fix JSDoc param annotations for tryNumber in query hooks * Address review: read tryNumber from searchParams, add comment, remove newsfragment * Address review: use TaskInstanceHistory for past tries to ensure validation and immutability * Fix ruff: remove duplicate test method and fix line length * Optimize: query TaskInstance before DAG parsing to fail fast on missing TI * Fix test: update missing_dag expected response after TI-first query reorder --------- (cherry picked from commit d440726) Co-authored-by: Shashwati Bhattacharyaa <166847329+shashbha14@users.noreply.github.com> Co-authored-by: Shashwati <shashwatibhattacaharya21.2@gmail.com>
* Forward try_number to extra links API for correct retry links * Rename newsfragment to match PR number * Add tryNumber to generated OpenAPI query hooks * Fix JSDoc param annotations for tryNumber in query hooks * Address review: read tryNumber from searchParams, add comment, remove newsfragment * Address review: use TaskInstanceHistory for past tries to ensure validation and immutability * Fix ruff: remove duplicate test method and fix line length * Optimize: query TaskInstance before DAG parsing to fail fast on missing TI * Fix test: update missing_dag expected response after TI-first query reorder --------- (cherry picked from commit d440726) Co-authored-by: Shashwati Bhattacharyaa <166847329+shashbha14@users.noreply.github.com> Co-authored-by: Shashwati <shashwatibhattacaharya21.2@gmail.com>
Operator extra links are cached as XCom rows under the link's xcom_key, which carries no attempt. XComOperatorLink.get_link receives a TaskInstanceKey and ignores its try_number, so once a task retries, asking for an earlier attempt's link returns the latest attempt's URL. apache#65661 made the endpoint resolve the requested attempt, which makes the wrong answer reachable from the UI. The worker now also caches the link under a key carrying the attempt that produced it, and the reader prefers that row, falling back to the bare key for links written before this change. Those rows are exempt from the clear a retry issues, since they describe attempts that already ran. The prefix is owned by Airflow rather than derived from the link's xcom_key, because a link may override that with any name, as the Databricks and Google links do. Closes: apache#71471 Signed-off-by: 1fanwang <1fannnw@gmail.com>
Operator extra links are cached as XCom rows under the link's xcom_key, which carries no attempt. XComOperatorLink.get_link receives a TaskInstanceKey and ignores its try_number, so once a task retries, asking for an earlier attempt's link returns the latest attempt's URL. apache#65661 made the endpoint resolve the requested attempt, which makes the wrong answer reachable from the UI. The worker now also caches the link under a key carrying the attempt that produced it, and the reader prefers that row, falling back to the bare key for links written before this change. Those rows are exempt from the clear a retry issues, since they describe attempts that already ran. The prefix is owned by Airflow rather than derived from the link's xcom_key, because a link may override that with any name, as the Databricks and Google links do. Closes: apache#71471 Signed-off-by: 1fanwang <1fannnw@gmail.com>
In case a user chooses a retry from past attempts in the Details tab, the extra links were being created only for the latest attempt and not for the chosen retry attempt. This PR fixes that by passing try_number to the extra links API. This closes: #65354
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Sonnet 4.6 following the guidelines
'@