tirkarthi opened a new pull request, #44989: URL: https://github.com/apache/airflow/pull/44989
Whenever a page is loaded the offset and limit values are passed to the API from pagination object. `limit` is fetched from `config` API through `page_size` in airflow.cfg. As `pagination.pageSize` is undefined `offset` which is `pagination.pageIndex * pagination.pageSize` becomes NaN and passed to the API causing backend to return 422 if the API call for a resource is made before `config` finishes. Once config finishes the offset value is calculated properly and then passed to API resulting in two API calls with 1 invalid returning 422 and then again passing with valid offset value to fetch the correct response. Use `enabled` option to not make call if the `offset` is `NaN`. Another option would be default value for `pagination.pageSize` but that would result in 2 API calls with default value and later the value from `config` API call. Another issue is that for running dagruns and running/deferred task instances the `end_date` is not present causing `NaN` to be displayed in UI in dagrun duration, task instance duration, etc. Use current time if end_date is not present like the legacy UI. To reproduce : 1. Open console and visit http://localhost:8000/webapp/dags 2. The console will log API calls sending NaN http://localhost:8000/public/dags?offset=NaN&only_active=true&order_by=-last_run_start_date http://localhost:8000/ui/dags/recent_dag_runs?dag_runs_limit=14&offset=NaN&only_active=true -- 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]
