frank-ye opened a new issue, #40828:
URL: https://github.com/apache/airflow/issues/40828

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.9.2
   
   ### What happened?
   
   I had a DAG that was missing the `start_date` parameter, and was able to 
successfully trigger it. Separately, I tried listing tasks for my application. 
When issuing the request (using Astro), I got the following error:
   
   ```
   {
       "detail": "None is not of type 'string'\n\nFailed validating 'type' in 
schema['properties']['tasks']['items']['properties']['start_date']:\n    
{'format': 'date-time', 'readOnly': True, 'type': 'string'}\n\nOn 
instance['tasks'][0]['start_date']:\n    None",
       "status": 500,
       "title": "Response body does not conform to specification",
       "type": 
"http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/stable/stable-rest-api-ref.html#section/Errors/Unknown";
   }
   ```
   
   After adding back the `start_date` in the DAG params like the following, the 
list tasks endpoint returns data again instead of erroring out.
   
   ```
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'start_date': datetime(2023, 6, 1),
       'retries': 1,
       'retry_delay': timedelta(minutes=5),
   }
   ```
   
   ### What you think should happen instead?
   
   I don't think the LIST tasks call should fail if the DAG start_time is not 
specified.
   
   ### How to reproduce
   
   1. Write a simple DAG except omit the `start_time` parameter.
   2. Issue a list task request as documented in: 
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances
   
   
   ### Operating System
   
   MacOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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