This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-0-test by this push:
new dfbeba310f3 [v3-0-test] Fetch only the most recent dagrun value for
list display. (#50834) (#50988)
dfbeba310f3 is described below
commit dfbeba310f369b2a5d8dbb77ad49d4fd97a6df78
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri May 23 15:52:47 2025 +0200
[v3-0-test] Fetch only the most recent dagrun value for list display.
(#50834) (#50988)
(cherry picked from commit bca010b3a837008858b1a3c44d6b068c8d2517bb)
Co-authored-by: Karthikeyan Singaravelan <[email protected]>
---
airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx | 3 ++-
airflow-core/src/airflow/ui/src/queries/useDags.tsx | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
index 934c0255980..34d4b86d154 100644
--- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx
@@ -150,6 +150,7 @@ const DAGS_LIST_DISPLAY = "dags_list_display";
export const DagsList = () => {
const [searchParams, setSearchParams] = useSearchParams();
const [display, setDisplay] = useLocalStorage<"card" |
"table">(DAGS_LIST_DISPLAY, "card");
+ const dagRunsLimit = display === "card" ? 14 : 1;
const hidePausedDagsByDefault =
Boolean(useConfig("hide_paused_dags_by_default"));
const defaultShowPaused = hidePausedDagsByDefault ? false : undefined;
@@ -193,7 +194,7 @@ export const DagsList = () => {
paused = false;
}
- const { data, error, isLoading } = useDags({
+ const { data, error, isLoading } = useDags(dagRunsLimit, {
dagDisplayNamePattern: Boolean(dagDisplayNamePattern) ?
`${dagDisplayNamePattern}` : undefined,
lastDagRunState,
limit: pagination.pageSize,
diff --git a/airflow-core/src/airflow/ui/src/queries/useDags.tsx
b/airflow-core/src/airflow/ui/src/queries/useDags.tsx
index d4f58dc985e..608ccedd5b8 100644
--- a/airflow-core/src/airflow/ui/src/queries/useDags.tsx
+++ b/airflow-core/src/airflow/ui/src/queries/useDags.tsx
@@ -25,6 +25,7 @@ export type DagWithLatest = {
} & DAGWithLatestDagRunsResponse;
export const useDags = (
+ dagRunsLimit: number,
searchParams: {
dagDisplayNamePattern?: string;
dagIdPattern?: string;
@@ -51,7 +52,7 @@ export const useDags = (
} = useDagsServiceRecentDagRuns(
{
...runsParams,
- dagRunsLimit: 14,
+ dagRunsLimit,
},
undefined,
{