dabla commented on code in PR #56973:
URL: https://github.com/apache/airflow/pull/56973#discussion_r3050590433


##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -86,21 +87,26 @@ def get_link(self, operator: BaseOperator, *, ti_key: 
TaskInstanceKey) -> str:
         if TYPE_CHECKING:
             assert isinstance(operator, TriggerDagRunOperator)
 
-        trigger_dag_id = operator.trigger_dag_id
-        if not AIRFLOW_V_3_0_PLUS:
-            from airflow.models.renderedtifields import 
RenderedTaskInstanceFields
-            from airflow.models.taskinstancekey import TaskInstanceKey as 
CoreTaskInstanceKey
-
-            core_ti_key = CoreTaskInstanceKey(
-                dag_id=ti_key.dag_id,
-                task_id=ti_key.task_id,
-                run_id=ti_key.run_id,
-                try_number=ti_key.try_number,
-                map_index=ti_key.map_index,
-            )
+        # Try to get the resolved dag_id from XCom first (for dynamic dag_ids)
+        trigger_dag_id = XCom.get_value(ti_key=ti_key, key=XCOM_DAG_ID)
+
+        # Fallback to operator attribute and rendered fields if not in XCom
+        if not trigger_dag_id:

Review Comment:
   This should become as @potiuk pointed out:
   
   `if trigger_dag_id is not None:`



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