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



##########
File path: airflow/models/dagrun.py
##########
@@ -798,7 +798,9 @@ def verify_integrity(self, session: Session = NEW_SESSION):
 
         def task_filter(task: "Operator") -> bool:
             return task.task_id not in task_ids and (
-                self.is_backfill or task.start_date <= self.execution_date
+                self.is_backfill
+                or task.start_date <= self.execution_date
+                and (task.end_date is None or self.execution_date <= 
task.end_date)
             )

Review comment:
       Let’s refactor this to early returns to improve readability, something 
like
   
   ```python
   def task_filter(task: "Operator") -> bool:
       if task.task_id in task_ids:
           return False
       if self.is_backfill:
           return ...
       ...
       return ...
   ```




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