XD-DENG commented on a change in pull request #5147: [AIRFLOW-4381] Use 
get_direct_relative_ids get task relatives
URL: https://github.com/apache/airflow/pull/5147#discussion_r277254618
 
 

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -896,11 +896,11 @@ def _set_relatives(self, task_or_task_list, 
upstream=False):
             if dag and not task.has_dag():
                 task.dag = dag
             if upstream:
-                task.add_only_new(task._downstream_task_ids, self.task_id)
+                
task.add_only_new(task.get_direct_relative_ids(upstream=False), self.task_id)
                 self.add_only_new(self._upstream_task_ids, task.task_id)
             else:
                 self.add_only_new(self._downstream_task_ids, task.task_id)
 
 Review comment:
   Actually I'm thinking should we make the same change here (for the two lines 
`self.add_only_new(self._upstream_task_ids, task.task_id)` & 
`self.add_only_new(self._downstream_task_ids, task.task_id)`) so the lines 
becomes consistent visually, even though they're the same under the hood.
   
   Let's have other committers' inputs here as well.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to