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



##########
File path: tests/timetables/test_interval_timetable.py
##########
@@ -40,6 +40,31 @@
 HOURLY_TIMEDELTA_TIMETABLE = 
DeltaDataIntervalTimetable(datetime.timedelta(hours=1))
 HOURLY_RELATIVEDELTA_TIMETABLE = 
DeltaDataIntervalTimetable(dateutil.relativedelta.relativedelta(hours=1))
 
+CRON_TIMETABLE = CronDataIntervalTimetable("30 21 * * *", TIMEZONE)
+
[email protected](
+    "timetable",
+    [
+        pytest.param(CRON_TIMETABLE, id="cron"),
+    ],
+)
[email protected](
+    "last_automated_data_interval",
+    [pytest.param(None, id="first-run"), pytest.param(PREV_DATA_INTERVAL, 
id="subsequent")],
+)
[email protected]_time(CURRENT_TIME)
+def test_no_catchup_first_starts_at_current_time(
+    timetable: Timetable,
+    last_automated_data_interval: Optional[DataInterval],
+) -> None:
+    """If ``catchup=False`` and start_date is a day before"""
+    next_info = timetable.next_dagrun_info(
+        last_automated_data_interval=last_automated_data_interval,
+        
restriction=TimeRestriction(earliest=CURRENT_TIME-datetime.timedelta(days=1), 
latest=None, catchup=False),

Review comment:
       But can you add a vector to paramtrize `earliest`? One for this value 
you use here, another for something like `CURRENT_TIME - 
datetime.timedelta(days=1, seconds=2)`.

##########
File path: tests/timetables/test_interval_timetable.py
##########
@@ -40,6 +40,31 @@
 HOURLY_TIMEDELTA_TIMETABLE = 
DeltaDataIntervalTimetable(datetime.timedelta(hours=1))
 HOURLY_RELATIVEDELTA_TIMETABLE = 
DeltaDataIntervalTimetable(dateutil.relativedelta.relativedelta(hours=1))
 
+CRON_TIMETABLE = CronDataIntervalTimetable("30 21 * * *", TIMEZONE)
+
[email protected](
+    "timetable",
+    [
+        pytest.param(CRON_TIMETABLE, id="cron"),
+    ],
+)

Review comment:
       I don’t think there’s need to parametrize this. This problem can only 
happen for the cron timetable, not anything else.




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