ephraimbuddy opened a new issue #12306:
URL: https://github.com/apache/airflow/issues/12306


   Getting a list of taskinstances where some taskinstances does not have start 
date, end date and state fails
   
   **Apache Airflow version**: 2.0
   
   **What happened**:
   Calling the endpoint 
`http://localhost:28080/api/v1//dags/~/dagRuns/~/taskInstances/list` with dags 
whose tasks instances have not started fails.
   
   ```
   {
       "detail": "None is not of type 'string'\n\nFailed validating 'type' in 
schema['allOf'][0]['properties']['task_instances']['items']['properties']['start_date']:\n
    {'format': 'datetime', 'type': 'string'}\n\nOn 
instance['task_instances'][9349]['start_date']:\n    None",
       "status": 500,
       "title": "Response body does not conform to specification",
       "type": 
"https://airflow.readthedocs.io/en/latest/stable-rest-api-ref.html#section/Errors/Unknown";
   }
   ```
   **What you expected to happen**:
   I expected to see a list of task instances like this:
   ```
   {
       "task_instances": [
           {
               "dag_id": "latest_only",
               "duration": 0.481884,
               "end_date": "2020-11-11T22:03:03.822310+00:00",
               "execution_date": "2020-11-10T12:00:00+00:00",
               "executor_config": "{}",
               "hostname": "7b6c973dde4b",
               "max_tries": 0,
               "operator": "LatestOnlyOperator",
               "pid": 1943,
               "pool": "default_pool",
               "pool_slots": 1,
               "priority_weight": 2,
               "queue": "default",
               "queued_when": "2020-11-11T22:03:02.648502+00:00",
               "sla_miss": null,
               "start_date": "2020-11-11T22:03:03.340426+00:00",
               "state": "success",
               "task_id": "latest_only",
               "try_number": 1,
               "unixname": "root"
           },
         {
               "dag_id": "example_branch_dop_operator_v3",
               "duration": null,
               "end_date": null,
               "execution_date": "2020-11-11T02:18:00+00:00",
               "executor_config": "{}",
               "hostname": "",
               "max_tries": 0,
               "operator": "BranchPythonOperator",
               "pid": null,
               "pool": "default_pool",
               "pool_slots": 1,
               "priority_weight": 3,
               "queue": "default",
               "queued_when": null,
               "sla_miss": null,
               "start_date": null,
               "state": null,
               "task_id": "condition",
               "try_number": 0,
               "unixname": "root"
           }
   ],
   "total_entries": 2
   }
   ```
   
   **How to reproduce it**:
   Call the endpoint 
`http://localhost:28080/api/v1//dags/~/dagRuns/~/taskInstances/list` with dags 
whose tasks instances have not started.


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