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


##########
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)
+

Review Comment:
   **Bug:** `if not trigger_dag_id:` uses a truthiness check. If 
`XCom.get_value` returns an empty string `""` (unlikely but possible), this 
would incorrectly fall through to the operator attribute fallback.
   
   Should be:
   `if trigger_dag_id is 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