uranusjr commented on code in PR #45175:
URL: https://github.com/apache/airflow/pull/45175#discussion_r1897135579


##########
airflow/timetables/simple.py:
##########
@@ -137,14 +137,18 @@ def next_dagrun_info(
     ) -> DagRunInfo | None:
         if restriction.earliest is None:  # No start date, won't run.
             return None
+
+        current_time = timezone.coerce_datetime(timezone.utcnow())
+
         if last_automated_data_interval is not None:  # has already run once
             start = last_automated_data_interval.end
-            end = timezone.coerce_datetime(timezone.utcnow())
+            end = current_time
+
+            if start > end:  # Skip scheduling if the last run ended in the 
future
+                return None

Review Comment:
   ```python
   if last_automated_data_interval.end > current_time:
       return None
   start = ...
   end = ...
   ```
   
   Exactly the same logic, but more readable IMO.



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