ccoliu commented on code in PR #76840:
URL: https://github.com/apache/airflow/pull/76840#discussion_r4534011721


##########
airflow-core/src/airflow/ui/src/components/Assets/AssetEvent.tsx:
##########
@@ -84,7 +86,15 @@ export const AssetEvent = ({
         <Box>{translate("source")}: </Box>
         {source === "" ? (
           <Link
-            
to={`/dags/${event.source_dag_id}/runs/${event.source_run_id}/tasks/${event.source_task_id}${event.source_map_index
 > -1 ? `/mapped/${event.source_map_index}` : ""}`}
+            to={getTaskInstanceLink({
+              dag_id: event.source_dag_id ?? "",
+              dag_run_id: event.source_run_id ?? "",
+              map_index: event.source_map_index,
+              // A task instance inside a task loop can only be addressed with 
its region.
+              region_id: event.source_region_id ?? undefined,
+              region_index: event.source_region_index ?? undefined,

Review Comment:
   Done. Hand-built task instance objects now have to pass `region_id: string | 
undefined` and `region_index: number | undefined`, so leaving them out is a 
type error. I kept `TaskInstanceResponse` accepted as-is, since the API omits 
both fields when a task instance has no region (`OmitsMissingRegion`), so 
making them required there would mean spreading the fields at every call site 
that passes a response straight through. I also checked the `dagId/dagRunId` 
callers: XCom, `useLogs` and the asset state store append the region to the 
search params themselves, and the task instance page only uses the path for a 
pathname comparison.



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