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



##########
File path: airflow/timetables/interval.py
##########
@@ -83,7 +83,12 @@ def next_dagrun_info(
         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
+            if restriction.catchup:
+                start = last_automated_data_interval.end
+            else:
+                # Catchup is False, we want the next run or latest which ever 
is greatest
+                start = max(last_automated_data_interval.end, earliest)

Review comment:
       I think this should actually be applied to when `catchup` is False as 
well. Because if we have (say) the DAG's `start_date` changed, subsequent runs 
should also abide to that new `start_date` instead of the old schedule.
   
   This also need an additional `if earliest is not None` check, otherwise it'd 
be possible to trigger a crash with
   
   1. Define a DAG with `catchup=False, start_date=yesterday`
   2. Wait for the first scheduled run
   3. Change the DAG to `start_date=None`
   
   Because this `max()` expression would end up being `max(last_interval_end, 
None)`.




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