Repository navigation
Allow search and filter by tags in dag run table #19197 - #66017
gdivya6028 wants to merge 11 commits into
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
| const { data: dagsData } = useQuery({ | ||
| enabled: dagTag !== null && dagTag !== "", | ||
| queryFn: () => | ||
| DagService.getDags({ | ||
| excludeStale: true, | ||
| lastDagRunState: "success", | ||
| limit: 50, | ||
| tags: dagTag !== null && dagTag !== "" ? [dagTag] : undefined, | ||
| tagsMatchMode: "any", | ||
| }), | ||
| queryKey: ["dags", dagTag], | ||
| }); | ||
|
|
||
| // ... (Keep your existing search param extractions here) | ||
| const filteredDagIds = React.useMemo(() => { | ||
| if (!dagsData?.dags) { | ||
| return []; | ||
| } | ||
|
|
||
| return dagsData.dags.map((dag: { dag_id: string }) => dag.dag_id); | ||
| }, [dagsData]); | ||
|
|
||
| // 2. Logic to calculate targetDagId | ||
| const targetDagId = React.useMemo(() => { | ||
| if (dagId !== "") { | ||
| return dagId; // Specific DAG page | ||
| } | ||
|
|
||
| if (dagTag !== null && dagTag !== "" && filteredDagIds.length === 0) { | ||
| return "~"; // No matches found | ||
| } | ||
|
|
||
| // If multiple IDs, use global wildcard "~" | ||
| if (filteredDagIds.length > 1) { | ||
| return "~"; | ||
| } | ||
|
|
||
| // If exactly one, use it directly | ||
| if (filteredDagIds.length === 1) { | ||
| return filteredDagIds[0]; | ||
| } | ||
|
|
||
| // No tag filter active | ||
| return "~"; | ||
| }, [dagId, dagTag, filteredDagIds]); | ||
|
|
||
| // Create the regex pattern | ||
| const multiDagPattern = React.useMemo(() => { | ||
| // Only use pattern if we have multiple IDs and no explicit dagId | ||
| if (dagId === "" && filteredDagIds.length > 1) { | ||
| return filteredDagIds.join("|"); | ||
| } |
There was a problem hiding this comment.
Thanks for the PR but that will probably not work.
The getDags endpoint is paginated so this can't work. (only the first 50 dags will be retained)
We need a new backend filter to implement that.
There was a problem hiding this comment.
hi @pierrejeambrun , could you please tell which backend api we can use or enhance? I've verified swagger apis for DagRuns earlier and they don't have DagTag field. So, I'm fetching DagIDs from Dags with selected DagTag from dropdown whose DagRuns are success and then passing these DagIDs result I got to DagRun Api to get the details for listing on page
There was a problem hiding this comment.
Yes, the API docs are based on our fastapi_api so we need to update the API itself here
|
@gdivya6028 This PR has been converted to draft because it has merge conflicts with Issues found:
What to do next:
Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards. No rush — take your time. If you have questions, feel free to ask on the Airflow Slack. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. |
|
sure @potiuk |
|
hi @potiuk , @bbovenzi i'm facing assets compilation error everytime i set up airflow in my local .. the below errors are with latest code. can you please help me in fixing these errors. executing cmd under airflow-core folder : breeze start-airflow dist, and node modules are present under provider assets and ui assets and build folder under airflow main folder **The asset compilation failed. Exiting. × providers/common/ai |
|
@gdivya6028 — good news first: this isn't a problem with your PR. The A few things to check:
For interactive setup help, #development in the ASF Slack is usually the fastest place — local-env issues are easier to debug there than in a PR thread. Your PR itself isn't blocked by this — once the assets compile locally you'll be able to push and let CI run. 👍 Drafted-by: Claude Code (Opus 4.8 1M context); reviewed by @potiuk before posting |
|
i've tried executing looks like breeze ui compile-assets cmd is failing in my local @potiuk i'm using node version : v22.22.3 × airflow-core
using node version : v22.22.3 Also, node modules and dist folder were successfully generated for airflow-core ui assets and provider-common-ai modules. |
|
build issue is resolved now @potiuk . i've uninstalled breeze (as there is a warning message in the screenshot i pasted above that it's an old version) and re-installed it using ./scripts/tools/setup_breeze. the application is up now. |
|
raising new MR, will be closing this one |
|
@gdivya6028 You can use any AI tools you want to help you in your contributions, just make sure to follow the project AI assisted guidelines: |

Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.