You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/31 16:13:53 UTC

[GitHub] [airflow] josh-fell commented on a change in pull request #21192: Update `ExternalTaskSensorLink` to handle templated `external_dag_id`

josh-fell commented on a change in pull request #21192:
URL: https://github.com/apache/airflow/pull/21192#discussion_r795829531



##########
File path: airflow/sensors/external_task.py
##########
@@ -40,6 +40,8 @@ class ExternalTaskSensorLink(BaseOperatorLink):
     name = 'External DAG'
 
     def get_link(self, operator, dttm):
+        ti = TaskInstance(task=operator, execution_date=dttm)
+        operator.render_template_fields({"ti": ti})

Review comment:
       Ah OK. Took a look at the other operator links too and all but one creates an ad hoc TaskInstance, but honestly those probably could just use `XCom.get_one()`.
   
   I'll update to use `ti.get_template_context()` in the meantime and test.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org