Skip to content

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

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

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

boring-cyborg Bot commented Apr 28, 2026

Copy link
Copy Markdown

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: [email protected]
    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("|");
}

@pierrejeambrun pierrejeambrun Apr 28, 2026 •

Copy link
Copy Markdown
Member

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.

@gdivya6028 gdivya6028 Apr 28, 2026 •

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.

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

@bbovenzi bbovenzi Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

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

potiuk commented May 18, 2026

Copy link
Copy Markdown
Member

@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

@gdivya6028

gdivya6028 commented Jun 9, 2026 •

Copy link
Copy Markdown
Author

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
  Compile Common AI provider assets......................................Failed
  - hook id: compile-common-ai-provider-assets
  - duration: 0.02s
  - exit code: 1
× airflow-core
  Compile ui assets (manual).............................................Failed
  - hook id: compile-ui-assets
  - duration: 0.01s
  - exit code: 1 (edited)**

@potiuk

potiuk commented Jun 9, 2026

Copy link
Copy Markdown
Member

@gdivya6028 — good news first: this isn't a problem with your PR. The compile-ui-assets / compile-common-ai-provider-assets steps fail at the local asset-build stage, which is almost always a local Node/pnpm environment mismatch rather than anything in your change.

A few things to check:

  1. Node + pnpm versions. The UI (airflow-core/src/airflow/ui) builds with Vite via pnpm and needs node ≥ 20 (22 recommended) and pnpm ≥ 9 — mismatched versions are the most common cause. See contributing-docs/15_node_environment_setup.rst; nvm helps manage the node version.
  2. Build the assets explicitly to see the real error: breeze compile-ui-assets (or pre-commit run compile-ui-assets --all-files). The hook output you pasted is truncated — it shows the hook failed but not why. The explicit command prints the actual Vite/pnpm error.
  3. If it still fails, please paste the full output from step 2 (everything after "Failed") — the first real error line is what we need to diagnose.

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

@gdivya6028

Copy link
Copy Markdown
Author

i've tried executing breeze ui compile-assets and i'm seeing a file named asset-compile.out generated with the below error message :

looks like breeze ui compile-assets cmd is failing in my local @potiuk

i'm using node version : v22.22.3
pnpm version : 10.33.0

× airflow-core
Compile ui assets (manual).............................................Failed

  • hook id: compile-ui-assets
  • duration: 0.74s
  • exit code: 1
image

using node version : v22.22.3
pnpm version : 10.33.0

Also, node modules and dist folder were successfully generated for airflow-core ui assets and provider-common-ai modules.

@gdivya6028

Copy link
Copy Markdown
Author

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.

@gdivya6028

Copy link
Copy Markdown
Author

raising new MR, will be closing this one

@gdivya6028

Copy link
Copy Markdown
Author

i've tried using github copilot today for raising new MR but deleted the branch and making the changes again manually now. Would like to know is it fine to use copilot, chatgpt ? @bbovenzi @potiuk

@pierrejeambrun

Copy link
Copy Markdown
Member

@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:
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

@gdivya6028 gdivya6028 closed this Jun 22, 2026
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