You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "imrichardwu (via GitHub)" <gi...@apache.org> on 2026/05/27 05:22:46 UTC
[PR] feat/browser: Add DataTable and browse UI components [airflow]
imrichardwu opened a new pull request, #67586:
URL: https://github.com/apache/airflow/pull/67586
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull request.
Write a good git commit message following this guide: http://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the documentation.
Feel free to ping (in general) for the review if you do not see reaction for a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
Add a global Deadlines view that displays all pending deadlines where deadline_time is in the future, as well as recently missed deadlines from the last 24 hours across all DAG runs, with clickable links to the corresponding DAG and DAG run for sorting and filtering. The dashboard shows the 5 most recent, and the user can view more in the browser section.
<img width="1511" height="729" alt="Screenshot 2026-04-07 at 9 15 10 PM" src="https://github.com/user-attachments/assets/ec5c8f10-22ab-42dd-bd30-55b4e00da1bc" />
<img width="1510" height="722" alt="Screenshot 2026-04-07 at 9 18 49 PM" src="https://github.com/user-attachments/assets/b55aa050-4817-4833-92cb-cb9dda65d5ff" />
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
<!--
Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
-->
---
* Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on PR #67586:
URL: https://github.com/apache/airflow/pull/67586#issuecomment-4565551186
@bbovenzi Can I get a review?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #67586:
URL: https://github.com/apache/airflow/pull/67586
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3356829310
##########
airflow-core/newsfragments/67586.significant.rst:
##########
@@ -0,0 +1,7 @@
+Add a new **Deadlines** page under the Browse menu.
+
+If you use the FAB auth manager with **custom roles**, grant the new
+``menu_access`` and ``can_read`` permissions on the ``Deadlines`` resource to
+any role that should be able to see this page. The built-in ``Viewer``,
+``User``, ``Op``, and ``Admin`` roles are updated automatically when Airflow
+starts (``[fab] UPDATE_FAB_PERMS = True``).
Review Comment:
lgtm
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3348219066
##########
providers/fab/src/airflow/providers/fab/www/security/permissions.py:
##########
@@ -35,6 +35,7 @@
RESOURCE_DAG_WARNING = "DAG Warnings"
RESOURCE_CLUSTER_ACTIVITY = "Cluster Activity"
RESOURCE_ASSET = "Assets"
+RESOURCE_DEADLINE = "Deadlines"
Review Comment:
Why?
##########
providers/fab/src/airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -268,6 +269,7 @@ class FabAirflowSecurityManagerOverride(AirflowSecurityManagerV2):
(permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_DAG_RUN),
(permissions.ACTION_CAN_ACCESS_MENU, RESOURCE_ASSET),
(permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_CLUSTER_ACTIVITY),
+ (permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_DEADLINE),
Review Comment:
?
Dealines menu item should map to dagrun. (Similarly to the API access for listing dealines), there is no 'deadlines' auth entity.
##########
airflow-core/newsfragments/67586.significant.rst:
##########
@@ -0,0 +1,7 @@
+Add a new **Deadlines** page under the Browse menu.
+
+If you use the FAB auth manager with **custom roles**, grant the new
+``menu_access`` and ``can_read`` permissions on the ``Deadlines`` resource to
+any role that should be able to see this page. The built-in ``Viewer``,
+``User``, ``Op``, and ``Admin`` roles are updated automatically when Airflow
+starts (``[fab] UPDATE_FAB_PERMS = True``).
Review Comment:
This needs to be generalized, It's not for fab only, but any auth manager with custom roles.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on PR #67586:
URL: https://github.com/apache/airflow/pull/67586#issuecomment-4658848395
> @imrichardwu are you taking of this? [#67586 (review)](https://github.com/apache/airflow/pull/67586#pullrequestreview-4402630796)
>
> > I believe this calls for an update in the FAB auth manager otherwise this menu won't be accessible.
> > And probably as well as a significant newsfragment to communicate that people needs to update their user permissions for them to be able to access this new 'menu'.
Already done
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on PR #67586:
URL: https://github.com/apache/airflow/pull/67586#issuecomment-4618616073
> UI looks good. Just one nit. I feel like we should move away from show the count of rows at the top of the table.
Random question, but do you have any advice on having bette titles for PRs?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3349247496
##########
airflow-core/newsfragments/67586.significant.rst:
##########
@@ -0,0 +1,7 @@
+Add a new **Deadlines** page under the Browse menu.
+
+If you use the FAB auth manager with **custom roles**, grant the new
+``menu_access`` and ``can_read`` permissions on the ``Deadlines`` resource to
+any role that should be able to see this page. The built-in ``Viewer``,
+``User``, ``Op``, and ``Admin`` roles are updated automatically when Airflow
+starts (``[fab] UPDATE_FAB_PERMS = True``).
Review Comment:
Would something like this be better? ```
Add a new **Deadlines** page under the Browse menu.
The page is accessible to any role that already has ``can_read`` and
``menu_access`` on ``DAG Runs``.
```
##########
airflow-core/newsfragments/67586.significant.rst:
##########
@@ -0,0 +1,7 @@
+Add a new **Deadlines** page under the Browse menu.
+
+If you use the FAB auth manager with **custom roles**, grant the new
+``menu_access`` and ``can_read`` permissions on the ``Deadlines`` resource to
+any role that should be able to see this page. The built-in ``Viewer``,
+``User``, ``Op``, and ``Admin`` roles are updated automatically when Airflow
+starts (``[fab] UPDATE_FAB_PERMS = True``).
Review Comment:
Would something like this be better?
```
Add a new **Deadlines** page under the Browse menu.
The page is accessible to any role that already has ``can_read`` and
``menu_access`` on ``DAG Runs``.
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #67586:
URL: https://github.com/apache/airflow/pull/67586#issuecomment-4623239206
> > UI looks good. Just one nit. I feel like we should move away from show the count of rows at the top of the table.
>
> Random question, but do you have any advice for writing better PR titles?
Think about a one sentence description in the release notes to understand what new feature was added.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3349322257
##########
providers/fab/src/airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -268,6 +269,7 @@ class FabAirflowSecurityManagerOverride(AirflowSecurityManagerV2):
(permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_DAG_RUN),
(permissions.ACTION_CAN_ACCESS_MENU, RESOURCE_ASSET),
(permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_CLUSTER_ACTIVITY),
+ (permissions.ACTION_CAN_ACCESS_MENU, permissions.RESOURCE_DEADLINE),
Review Comment:
Your right
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3349247496
##########
airflow-core/newsfragments/67586.significant.rst:
##########
@@ -0,0 +1,7 @@
+Add a new **Deadlines** page under the Browse menu.
+
+If you use the FAB auth manager with **custom roles**, grant the new
+``menu_access`` and ``can_read`` permissions on the ``Deadlines`` resource to
+any role that should be able to see this page. The built-in ``Viewer``,
+``User``, ``Op``, and ``Admin`` roles are updated automatically when Airflow
+starts (``[fab] UPDATE_FAB_PERMS = True``).
Review Comment:
Would something like this be better or is it too short?
```
Add a new **Deadlines** page under the Browse menu.
The page is accessible to any role that already has ``can_read`` and
``menu_access`` on ``DAG Runs``.
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat/browser: Add DataTable and browse UI components [airflow]
Posted by "imrichardwu (via GitHub)" <gi...@apache.org>.
imrichardwu commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3349239764
##########
providers/fab/src/airflow/providers/fab/www/security/permissions.py:
##########
@@ -35,6 +35,7 @@
RESOURCE_DAG_WARNING = "DAG Warnings"
RESOURCE_CLUSTER_ACTIVITY = "Cluster Activity"
RESOURCE_ASSET = "Assets"
+RESOURCE_DEADLINE = "Deadlines"
Review Comment:
I initially followed the AIRFLOW_V_3_1_PLUS pattern, but I just realized that it isn't needed based on your second comment. Thanks for letting me know.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #67586:
URL: https://github.com/apache/airflow/pull/67586#discussion_r3351429580
##########
airflow-core/src/airflow/ui/src/pages/Deadlines/index.tsx:
##########
@@ -0,0 +1,155 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Badge, Box, Heading, Link, VStack } from "@chakra-ui/react";
+import type { ColumnDef } from "@tanstack/react-table";
+import type { TFunction } from "i18next";
+import { useTranslation } from "react-i18next";
+import { Link as RouterLink, useSearchParams } from "react-router-dom";
+
+import { useDeadlinesServiceGetDeadlines } from "openapi/queries";
+import type { DeadlineResponse } from "openapi/requests/types.gen";
+import { DataTable } from "src/components/DataTable";
+import { useTableURLState } from "src/components/DataTable/useTableUrlState";
+import { ErrorAlert } from "src/components/ErrorAlert";
+import { FilterBar } from "src/components/FilterBar";
+import Time from "src/components/Time";
+import { TruncatedText } from "src/components/TruncatedText";
+import { SearchParamsKeys } from "src/constants/searchParams";
+import { useFiltersHandler, type FilterableSearchParamsKeys } from "src/utils";
+
+type DeadlineRow = { row: { original: DeadlineResponse } };
+
+const createColumns = (translate: TFunction): Array<ColumnDef<DeadlineResponse>> => [
+ {
+ accessorKey: "dag_id",
+ cell: ({ row: { original } }: DeadlineRow) => (
+ <Link asChild color="fg.info">
+ <RouterLink to={`/dags/${original.dag_id}`}>
+ <TruncatedText text={original.dag_id} />
+ </RouterLink>
+ </Link>
+ ),
+ header: translate("common:dagId"),
+ },
+ {
+ accessorKey: "dag_run_id",
+ cell: ({ row: { original } }: DeadlineRow) => (
+ <Link asChild color="fg.info">
+ <RouterLink to={`/dags/${original.dag_id}/runs/${original.dag_run_id}`}>
+ <TruncatedText text={original.dag_run_id} />
+ </RouterLink>
+ </Link>
+ ),
+ enableSorting: false,
+ header: translate("common:dagRunId"),
+ },
+ {
+ accessorKey: "deadline_time",
+ cell: ({ row: { original } }: DeadlineRow) => <Time datetime={original.deadline_time} />,
+ header: translate("browse:deadlines.columns.deadlineTime"),
+ },
+ {
+ accessorKey: "missed",
+ cell: ({
+ row: {
+ original: { missed },
+ },
+ }) => (
+ <Badge colorPalette={missed ? "red" : "blue"} size="sm" variant="solid">
+ {missed
+ ? translate("browse:deadlines.filters.statusOptions.missed")
+ : translate("browse:deadlines.filters.statusOptions.pending")}
+ </Badge>
+ ),
+ header: translate("browse:deadlines.columns.status"),
+ },
+ {
+ accessorKey: "alert_name",
+ cell: ({ row: { original } }) => original.alert_name ?? "",
+ enableSorting: false,
+ header: translate("browse:deadlines.columns.alertName"),
+ },
+ {
+ accessorKey: "created_at",
+ cell: ({ row: { original } }: DeadlineRow) => <Time datetime={original.created_at} />,
+ header: translate("common:table.createdAt"),
+ },
+];
+
+const deadlinesFilterKeys: Array<FilterableSearchParamsKeys> = [
+ SearchParamsKeys.DAG_ID,
+ SearchParamsKeys.DEADLINE_TIME_RANGE,
+ SearchParamsKeys.MISSED,
+];
+
+export const Deadlines = () => {
+ const { t: translate } = useTranslation(["browse", "common"]);
+ const { setTableURLState, tableURLState } = useTableURLState();
+ const [searchParams] = useSearchParams();
+
+ const { filterConfigs, handleFiltersChange, initialValues } = useFiltersHandler(deadlinesFilterKeys);
+
+ const columns = createColumns(translate);
+
+ const { pagination, sorting } = tableURLState;
+ const [sort] = sorting;
+ const orderBy = sort ? [`${sort.desc ? "-" : ""}${sort.id}`] : ["-deadline_time"];
+
+ const filteredDagId = searchParams.get(SearchParamsKeys.DAG_ID);
+ const filteredMissed = searchParams.get(SearchParamsKeys.MISSED);
+ const deadlineTimeGte = searchParams.get(SearchParamsKeys.DEADLINE_TIME_GTE);
+ const deadlineTimeLte = searchParams.get(SearchParamsKeys.DEADLINE_TIME_LTE);
+
+ const missedFilter = filteredMissed === "true" ? true : filteredMissed === "false" ? false : undefined;
+
+ const { data, error, isFetching, isLoading } = useDeadlinesServiceGetDeadlines({
+ dagId: filteredDagId !== null && filteredDagId !== "" ? filteredDagId : "~",
+ dagRunId: "~",
+ deadlineTimeGte: deadlineTimeGte ?? undefined,
+ deadlineTimeLte: deadlineTimeLte ?? undefined,
+ limit: pagination.pageSize,
+ missed: missedFilter,
+ offset: pagination.pageIndex * pagination.pageSize,
+ orderBy,
+ });
+
+ return (
+ <Box p={2}>
+ <Heading>{translate("browse:deadlines.title")}</Heading>
+ <VStack align="start" gap={4} paddingY="4px">
+ <FilterBar
+ configs={filterConfigs}
+ initialValues={initialValues}
+ onFiltersChange={handleFiltersChange}
+ />
+ </VStack>
+ <DataTable
+ columns={columns}
+ data={data?.deadlines ?? []}
+ errorMessage={<ErrorAlert error={error} />}
+ initialState={tableURLState}
+ isFetching={isFetching}
+ isLoading={isLoading}
+ modelName="browse:deadlines.deadline"
+ onStateChange={setTableURLState}
Review Comment:
```suggestion
onStateChange={setTableURLState}
showRowCountHeading={false}
```
Nit
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Browse > Deadlines page [airflow]
Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on PR #67586:
URL: https://github.com/apache/airflow/pull/67586#issuecomment-4658233108
@imrichardwu are you taking of this?
https://github.com/apache/airflow/pull/67586#pullrequestreview-4402630796
> I believe this calls for an update in the FAB auth manager otherwise this menu won't be accessible.
>
> And probably as well as a significant newsfragment to communicate that people needs to update their user permissions for them to be able to access this new 'menu'.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org