This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 7ddb8446d9d [v3-1-test] Don't fetch ImportError until modal opens. Use
limit as 1 since the UI shows total_entries value and rest of the response is
ignored. (#57624) (#57757)
7ddb8446d9d is described below
commit 7ddb8446d9d7a1ebcc8d8eed888b1eb604a06320
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Nov 5 16:29:54 2025 -0500
[v3-1-test] Don't fetch ImportError until modal opens. Use limit as 1 since
the UI shows total_entries value and rest of the response is ignored. (#57624)
(#57757)
* [v3-1-test] Don't fetch ImportError until modal opens. Use limit as 1
since the UI shows total_entries value and rest of the response is ignored.
(#57624)
(cherry picked from commit c1162b09f05cc47a31694bdb338c9271bd68fb3e)
Co-authored-by: Karthikeyan Singaravelan <[email protected]>
* Fix props order
---------
Co-authored-by: Karthikeyan Singaravelan <[email protected]>
Co-authored-by: Brent Bovenzi <[email protected]>
---
.../ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx | 2 +-
.../ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx | 14 +++++++++-----
airflow-core/src/airflow/ui/src/utils/query.ts | 1 +
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git
a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
index 87b9bf917e0..9819987aa63 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
@@ -33,7 +33,7 @@ export const DAGImportErrors = ({ iconOnly = false }: {
readonly iconOnly?: bool
const isRTL = i18n.dir() === "rtl";
- const { data, error, isLoading } = useImportErrorServiceGetImportErrors();
+ const { data, error, isLoading } = useImportErrorServiceGetImportErrors({
limit: 1 });
const importErrorsCount = data?.total_entries ?? 0;
if (isLoading) {
diff --git
a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx
b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx
index e38d06a26f4..f27756003fb 100644
---
a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx
+++
b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx
@@ -39,11 +39,15 @@ export const DAGImportErrorsModal:
React.FC<ImportDAGErrorModalProps> = ({ onClo
const [page, setPage] = useState(1);
const [searchQuery, setSearchQuery] = useState("");
- const { data } = useImportErrorServiceGetImportErrors({
- filenamePattern: searchQuery || undefined,
- limit: PAGE_LIMIT,
- offset: PAGE_LIMIT * (page - 1),
- });
+ const { data } = useImportErrorServiceGetImportErrors(
+ {
+ filenamePattern: searchQuery || undefined,
+ limit: PAGE_LIMIT,
+ offset: PAGE_LIMIT * (page - 1),
+ },
+ undefined,
+ { enabled: open },
+ );
const { t: translate } = useTranslation(["dashboard", "components"]);
diff --git a/airflow-core/src/airflow/ui/src/utils/query.ts
b/airflow-core/src/airflow/ui/src/utils/query.ts
index 6a0b072ca59..10c031f47e3 100644
--- a/airflow-core/src/airflow/ui/src/utils/query.ts
+++ b/airflow-core/src/airflow/ui/src/utils/query.ts
@@ -50,6 +50,7 @@ export const useAutoRefresh = ({
const { data: dagRunData } = useDagRunServiceGetDagRuns(
{
dagId: dagId ?? "~",
+ limit: 1,
state: ["running", "queued"],
},
undefined,