yuqian90 commented on issue #11819:
URL: https://github.com/apache/airflow/issues/11819#issuecomment-726766782


   > @yuqian90 is this an easy fix to backport it to 1.10? Even if 2.0 is 
around the corner this is a functionality bug that might cause DAGs not to work 
as expected. Also not all organizations will move quickly to 2.0 it will take 
time.
   
   I'd love to help but don't have time at the moment. I can see the change 
needed is rather small. To achieve what you want, you can make this one line 
change to `latest_only_operator.py` and use it as a custom operator:
   
   ```python
   diff --git a/airflow/operators/latest_only_operator.py 
b/airflow/operators/latest_only_operator.py
   index c95ceacbd..68ce083a9 100644
   --- a/airflow/operators/latest_only_operator.py
   +++ b/airflow/operators/latest_only_operator.py
   @@ -55,7 +55,7 @@ class LatestOnlyOperator(BaseOperator, SkipMixin):
            if not left_window < now <= right_window:
                self.log.info('Not latest execution, skipping downstream.')
   
   -            downstream_tasks = 
context['task'].get_flat_relatives(upstream=False)
   +            downstream_tasks = 
context['task'].get_direct_relatives(upstream=False)
                self.log.debug("Downstream task_ids %s", downstream_tasks)
   
                if downstream_tasks:
   ```
   
   Or alternatively, if you don't mind putting up a PR to cherry-pick this 
change from master branch and apply it against v1-10-test branch, that'll be 
even better: https://github.com/apache/airflow/pull/5778


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


Reply via email to