XD-DENG commented on a change in pull request #14416:
URL: https://github.com/apache/airflow/pull/14416#discussion_r581914925



##########
File path: tests/models/test_taskinstance.py
##########
@@ -1488,6 +1488,30 @@ def test_previous_start_date_success(self, _, 
schedule_interval, catchup) -> Non
         assert ti_list[3].get_previous_start_date(state=State.SUCCESS) == 
ti_list[1].start_date
         assert ti_list[3].get_previous_start_date(state=State.SUCCESS) != 
ti_list[2].start_date
 
+    def test_get_previous_start_date_none(self):
+        """
+        Test that get_previous_start_date() can handle TaskInstance with no 
start_date.
+        """
+        with DAG("test_get_previous_start_date_none", start_date=DEFAULT_DATE, 
schedule_interval=None) as dag:
+            task = DummyOperator(task_id="op")
+
+        dag.create_dagrun(
+            execution_date=DEFAULT_DATE,
+            state=State.RUNNING,

Review comment:
       This may be different from the example scenario you gave in the PR 
description? ("*e.g. previous instance was marked success without running*")




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to