You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/24 22:43:47 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #14416: Fix crash when user clicks on "Task Instance Details" caused by start_date being None

kaxil commented on a change in pull request #14416:
URL: https://github.com/apache/airflow/pull/14416#discussion_r582358984



##########
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:
       @yuqian90 




----------------------------------------------------------------
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:
users@infra.apache.org