예제 #1
0
 def get_link(
     self,
     operator: "AbstractOperator",
     *,
     ti_key: "TaskInstanceKey",
 ) -> str:
     # Fetch the correct execution date for the triggerED dag which is
     # stored in xcom during execution of the triggerING task.
     when = XCom.get_value(ti_key=ti_key, key=XCOM_EXECUTION_DATE_ISO)
     query = {
         "dag_id": cast(TriggerDagRunOperator, operator).trigger_dag_id,
         "base_date": when
     }
     return build_airflow_url_with_query(query)
예제 #2
0
 def get_link(
     self,
     operator,
     dttm: Optional[datetime] = None,
     ti_key: Optional["TaskInstanceKey"] = None,
 ) -> str:
     if ti_key is not None:
         conf = XCom.get_value(key=self.key, ti_key=ti_key)
     else:
         assert dttm
         conf = XCom.get_one(
             dag_id=operator.dag.dag_id,
             task_id=operator.task_id,
             execution_date=dttm,
             key=self.key,
         )
     return (conf["url"].format(
         region=conf["region"],
         service_id=conf["service_id"],
         project_id=conf["project_id"],
     ) if conf else "")