This is an automated email from the ASF dual-hosted git repository.
uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 829f90a Fix queued dag runs changes catchup=False behaviour (#19130)
829f90a is described below
commit 829f90ad337c2ea94db7cd58ccdd71dd680ad419
Author: Robin Edwards <[email protected]>
AuthorDate: Fri Oct 22 02:03:59 2021 +0100
Fix queued dag runs changes catchup=False behaviour (#19130)
---
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)