bugraoz93 commented on PR #43846:
URL: https://github.com/apache/airflow/pull/43846#issuecomment-2468908783

   > > Doesn't this always add running dags even when I set my end_date param 
to be in the past? (ex: I only wanted to look at dag runs from last week)
   > 
   > When the dagrun started in the last week after given start_date in the UI 
and yet to finish with end_date as None for the dagrun it will be present in 
the API with this change. Before this change it won't be shown.
   
   I dug more after the answers since this was the case in the `legacy api`. We 
should check the parameters.py rather than editing the endpoint itself. We 
should return None here similar to the old version. I think I made it 
`ValueError` if `end_date` is not provided but as @bbovenzi said we can make 
this value `None` when it's not provided (optional).
   
   **Where we should change:**
   
https://github.com/apache/airflow/blob/2105c94854a2f8d5d2411d08a66e6d5f7002c8d4/airflow/api_fastapi/common/parameters.py#L373-L374
   **Where it was before:**
   
https://github.com/apache/airflow/blob/2105c94854a2f8d5d2411d08a66e6d5f7002c8d4/airflow/www/views.py#L294-L295
   
   Of course, we should adjust this to make FastAPI accept the value as 
optional in the endpoint.
   
https://github.com/apache/airflow/blob/2105c94854a2f8d5d2411d08a66e6d5f7002c8d4/airflow/api_fastapi/core_api/routes/ui/dashboard.py#L49
   -> `end_date: DateTimeQuery | None,`
   
   I haven't fully tested the changes but from the conversation, this could 
lead to `None` values not returning. Because it's not allowing `None` values at 
the moment when you pass `None`. The query should behave the same since there 
aren't any changes on how we are querying the database :thinking:


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