fredthomsen opened a new pull request, #62079:
URL: https://github.com/apache/airflow/pull/62079
1 Previously, adding extra links to a TaskFlow task required creating
2 a custom BaseOperator subclass with operator_extra_links and a
3 companion BaseOperatorLink class. This is heavyweight for what is
4 often just a URL set at runtime.
5
6 This change lets @task authors declare link names in the decorator
7 and set URLs directly during execution:
8
9 ```python
10 @task(extra_links=["Docs"])
11 def my_task(extra_links):
12 extra_links["Docs"] = "https://example.com"
13 ```
14
15 **What's included:**
16
17 - `TaskFlowExtraLink` — a concrete `BaseOperatorLink` that stores
18 URLs via XCom, created at parse time from declared link names
19 - `_build_extra_links()` merges TaskFlow links with existing
20 class-level links, warning on name conflicts
21 - `ExtraLinksAccessor` — dict-like context object injected as
22 `context["extra_links"]` for setting URLs during execution
23 - Mapped operators retain extra links through `unmap()`
24 - Serialization/deserialization works via existing
`operator_extra_links`
25 machinery (no new XCom keys or API changes needed)
26
27 closes: #54527
28
29 ---
30
31 ##### Was generative AI tooling used to co-author this PR?
32
33 - [X] Yes — Claude Code (Claude Opus 4.6)
34
35 Generated-by: Claude Code following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
36
37 ---
38
39 * Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
40 * For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
41 * When adding dependency, check compliance with the [ASF 3rd Party
License Policy](https://www.apache.org/legal/resolved.html#category-x).
42 * For significant user-facing changes create newsfragment:
`{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]