pierrejeambrun commented on code in PR #65661:
URL: https://github.com/apache/airflow/pull/65661#discussion_r3131680144


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/extra_links.py:
##########
@@ -75,6 +76,11 @@ def get_extra_links(
             "TaskInstance not found",
         )
 
+    if try_number is not None:
+        # We only need to override try_number on the existing TI to generate
+        # attempt-specific links; fetching the full TaskInstanceHistory is 
unnecessary.
+        ti.try_number = try_number

Review Comment:
   Maybe going through the TIH is better at this point. (For validation and 
immutability) because link generation can use other things such as 
     - ti.log_url, ti.dag_version, ti.dag_version_id (for versioned links),     
                                                                                
                                                
     - ti.start_date / ti.end_date (for CloudWatch / GCP log windows),          
                                                                                
                                                
     - ti.hostname, ti.queued_dttm, ti.operator, xcom_pull(...) via ti_key,
     - anything BaseOperatorLink uses via ti_key.run_id + try_number against 
the historical state.                                                           
                                                   
   
   So we can't patch the TI like this.



-- 
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]

Reply via email to