uranusjr commented on a change in pull request #21192:
URL: https://github.com/apache/airflow/pull/21192#discussion_r795007832



##########
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:
       Hmm, we should try to discourage creating ad-hoc TaskInstance objects 
since it is much too brittle now that it has a foreign key to DagRun. Not sure 
what’s a good alternative though. @ashb Maybe this is a good time to (finally) 
start working on a new interface for this?
   
   Also instead of just `{"ti": ti}` we should likely use 
`ti.get_template_context()`.




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