Skip to content

Allow search and filter by tags in dag run table #19197#66017

Draft
gdivya6028 wants to merge 11 commits into
apache:mainfrom
gdivya6028:feature-allow-search-and-filter-by-tags
Draft

Allow search and filter by tags in dag run table #19197#66017
gdivya6028 wants to merge 11 commits into
apache:mainfrom
gdivya6028:feature-allow-search-and-filter-by-tags

Conversation

@gdivya6028
Copy link
Copy Markdown


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 28, 2026

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
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@gdivya6028 gdivya6028 changed the title Feature allow search and filter by tags Allow search and filter by tags in dag run table #19197 Apr 28, 2026
Comment on lines +240 to +291
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("|");
}
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@gdivya6028 gdivya6028 Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the API docs are based on our fastapi_api so we need to update the API itself here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working on the changes

@potiuk potiuk marked this pull request as draft May 18, 2026 08:56
@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 18, 2026

@gdivya6028 This PR has been converted to draft because it has merge conflicts with main that prevent CI from running cleanly — see our Pull Request quality criteria.

Issues found:

  • Merge conflicts: this PR cannot be cleanly merged into main. Rebase your branch onto the latest main, resolve any conflicts locally, then force-push. See the working-with-git docs.

What to do next:

  • git fetch upstream main && git rebase upstream/main, resolve conflicts, then git push --force-with-lease.
  • Once the rebase is in and CI re-triggers cleanly, mark the PR as "Ready for review".

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.

@gdivya6028
Copy link
Copy Markdown
Author

sure @potiuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants