bbovenzi commented on code in PR #75608:
URL: https://github.com/apache/airflow/pull/75608#discussion_r4458953322


##########
airflow-core/src/airflow/ui/src/pages/Run/Header.tsx:
##########
@@ -63,8 +64,16 @@ export const Header = ({ dagRun }: { readonly dagRun: 
DAGRunResponse }) => {
   const dagId = dagRun.dag_id;
   const dagRunId = dagRun.dag_run_id;
 
-  const { data: alertData } = useDeadlinesServiceGetDagDeadlineAlerts({ dagId 
});
-  const hasDeadlineAlerts = (alertData?.total_entries ?? 0) > 0;
+  const { data: alertData } = useDeadlinesServiceGetDagDeadlineAlerts({ dagId, 
dagRunId, limit: 100 });
+  const { data: deadlineData } = useDeadlinesServiceGetDeadlines({
+    dagId,
+    dagRunId,
+    limit: 10,
+    orderBy: ["deadline_time"],
+  });

Review Comment:
   Two queries just to get `hasDeadlineAlerts` feels excessive. Let's try to 
clean that up.



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