Skip to content

Filter stale Dag tags from public API (#66827)#69156

Merged
pierrejeambrun merged 3 commits into
apache:mainfrom
deepujain:fix-66827-stale-dag-tags
Jul 6, 2026
Merged

Filter stale Dag tags from public API (#66827)#69156
pierrejeambrun merged 3 commits into
apache:mainfrom
deepujain:fix-66827-stale-dag-tags

Conversation

@deepujain

@deepujain deepujain commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Title: Filter stale Dag tags from public API (#66827)

Summary

The public Dag tags endpoint returned tag names directly from dag_tag, so tags attached only to stale Dags could remain visible in the UI filter after the Dag file was removed. This filters tags through non-stale DagModel rows while preserving tags that are still attached to active Dags.

Changes

  • airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py -- join DagTag through DagModel and exclude stale Dag rows before grouping tag names.
  • airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_tags.py -- add a stale-only tag case while keeping a shared active/stale tag to prove active tags are not dropped.

Screenshot

PR 69156 stale Dag tags comparison

Test plan

  • ruff format --check airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_tags.py
  • ruff check airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_tags.py
  • AIRFLOW_HOME=/private/tmp/airflow-test-66827 uvx --from uv==0.11.21 uv run --project airflow-core pytest airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_tags.py::TestDagTags::test_get_dag_tags -xvs --with-db-init
  • CI passes
Was generative AI tooling used to co-author this PR?
  • Yes (OpenAI Codex)

Generated-by: OpenAI Codex following the guidelines

Fixes #66827

@shahar1 shahar1 left a comment

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.

@deepujain please note that you (or your operator) should include AI attribution in the PR as we state in the AI guidelines.
This PR, as well as others, are blocked from being merged until this is corrected.
Please be warned that creating additional PRs except for the 10 you've already created (listed below) without addressing the above might cause in a permanent block from Apache organization on GitHub.

List of PRs:

@shahar1 shahar1 dismissed their stale review June 30, 2026 06:26

AI attribution addressed

@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.1 milestone Jul 2, 2026

@pierrejeambrun pierrejeambrun left a comment

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.

LGTM, working as expected, tested locally.

Just one suggestion, good to merge after that.

Comment thread airflow-core/newsfragments/69156.bugfix.rst Outdated
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 2, 2026
@deepujain deepujain requested a review from henry3260 as a code owner July 3, 2026 01:39
@deepujain

Copy link
Copy Markdown
Contributor Author

Removed airflow-core/newsfragments/69156.bugfix.rst as requested. This follow-up is deletion-only, and git diff --check is clean.


Drafted-by: OpenAI Codex (no human review before posting)

@pierrejeambrun pierrejeambrun merged commit 6e97d87 into apache:main Jul 6, 2026
78 checks passed
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 ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not in use tags are still present in the search bar of the UI

4 participants