zhongjiajie 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_r277260817
##########
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:
IMO, both two ways are acceptable, but `self._private_member` is better way
to entry private member.
----------------------------------------------------------------
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