This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 61cb1f5ffb1f5d77926726b8c93697aed6c83cc1
Author: Robin Edwards <[email protected]>
AuthorDate: Fri Oct 22 02:03:59 2021 +0100

    Fix queued dag runs changes catchup=False behaviour (#19130)
    
    (cherry picked from commit 829f90ad337c2ea94db7cd58ccdd71dd680ad419)
---
 airflow/timetables/interval.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/airflow/timetables/interval.py b/airflow/timetables/interval.py
index 8f5c3f1..0dd7ffd 100644
--- a/airflow/timetables/interval.py
+++ b/airflow/timetables/interval.py
@@ -81,9 +81,15 @@ class _DataIntervalTimetable(Timetable):
                 return None
             start = self._align(earliest)
         else:
-            # There's a previous run. Create a data interval starting from when
-            # the end of the previous interval.
-            start = last_automated_data_interval.end
+            # There's a previous run.
+            if earliest is not None:
+                # Catchup is False or DAG has new start date in the future.
+                # Make sure we get the latest start date
+                start = max(last_automated_data_interval.end, earliest)
+            else:
+                # Create a data interval starting from when the end of the 
previous interval.
+                start = last_automated_data_interval.end
+
         if restriction.latest is not None and start > restriction.latest:
             return None
         end = self._get_next(start)

Reply via email to