Filter stale Dag tags from public API (#66827)#69156
Conversation
shahar1
left a comment
There was a problem hiding this comment.
@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:
pierrejeambrun
left a comment
There was a problem hiding this comment.
LGTM, working as expected, tested locally.
Just one suggestion, good to merge after that.
|
Removed Drafted-by: OpenAI Codex (no human review before posting) |
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-staleDagModelrows while preserving tags that are still attached to active Dags.Changes
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py-- joinDagTagthroughDagModeland 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
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.pyruff 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.pyAIRFLOW_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-initWas generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex following the guidelines
Fixes #66827