-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Allow null for end_date to fetch dags in running state without end_date. #43846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This part was lifted and shifted from I will have time to check this in detail in 3-4 hours. If you think it is not working as expected, this should be a bug and we should fix it for old versions too. If you think this part doesn't provide enough latency to the new UI then, it makes sense to make the changes. |
|
It seems the default filters in cluster activity add 1 hour to current time as airflow/airflow/www/static/js/cluster-activity/useFilters.tsx Lines 52 to 59 in 6d85a04
|
|
We should take a step back and clarify the intended use case for the It would be beneficial to get @bbovenzi and @pierrejeambrun’s input to gain the overall vision of the dashboard’s requirements. |
|
IMO not showing running dagruns reduces the value of the new dashboard. The running dagruns are present in current cluster activity page too. When I raised the PR I thought it was a bug. It comes to a decision over adding 1hr in UI like cluster activity or changing the API as per the PR to imply dagruns without end_date as running. |
|
Doesn't this always add running dags even when I set my I think there's a few ways to redo this:
|
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 Where we should change: airflow/airflow/api_fastapi/common/parameters.py Lines 373 to 374 in 2105c94
Where it was before: Lines 294 to 295 in 2105c94
Of course, we should adjust this to make FastAPI accept the value as optional in the endpoint.
-> end_date: DateTimeQuery | None,
I haven't fully tested the changes but from the conversation, this could lead to |
|
I can help with the changes and testing if you’d like, @tirkarthi. This issue originated from my change, but if you already have a UI set up for testing, it would be much faster to verify the changes through the UI, as it would show exactly what’s needed. Let me know how you’d like to proceed! |
|
@bugraoz93 You can use this in the UI: #43888 I agree that we should allow end_date be |
Yes I think we need to pay attention to that case. Allowing end_date to be none is perfectly fine. The backend can fill it with Or we can make a case in the Query. We take dags with |
|
Closing in favour of #44043 . Thanks everyone for the details. |
While working on #42700 I found that dagruns in running state without
end_dateare not returned even with current time sent asend_date. It seems that in the queryend_dateon being null usestimezone.utcnow()which will have a value greater than the frontendend_datevalue due to HTTP latency in the order of milliseconds to seconds thus never returning running dagruns and task instances associated with the corresponding dagrun. It's okay to allow dagruns with a start_date and no end_date which usually means they are in running state. Please correct me if I am missing any scenario regarding this.airflow/airflow/api_fastapi/core_api/routes/ui/dashboard.py
Lines 56 to 58 in 340a70b
cc: @bugraoz93 for #42629