seunggabi opened a new pull request, #77622:
URL: https://github.com/apache/airflow/pull/77622

   The Dag list can narrow results to Dags that **have** some tags or whose 
name **matches** a term, but there is no way to say "everything except ...". 
With many Dags it is common to want to hide, for example, every Dag tagged 
`deprecated` / `example`, or every Dag whose name contains `test`.
   
   **Exclude by tag**
   
   - New `exclude_tags` query parameter on `GET /api/v2/dags`, `PATCH 
/api/v2/dags` and the UI Dag list endpoint (they share `QueryTagsFilter`). A 
Dag is dropped if it has **any** of the given tags. It combines with `tags` / 
`tags_match_mode`, e.g. `tags=team_a&exclude_tags=deprecated`.
   - New **Exclude Tags** filter in the Dag list filter bar, reusing the 
existing tag picker.
   
   **Exclude by search term**
   
   - In the Dag list search box (`dag_display_name_pattern` and 
`dag_display_name_prefix_pattern`), a term prefixed with `-` now excludes the 
Dags it matches. It works with the existing `|` OR syntax: `etl|-test` = names 
matching `etl`, minus those matching `test`; `-test` alone = every Dag except 
those matching `test`.
   - Works for both the default prefix search and advanced (substring) search.
   - Opt-in per parameter (`minus_as_not=True` on the search param factories), 
enabled only for the Dag display name patterns. Every other `*_pattern` / 
`*_prefix_pattern` parameter keeps matching `-` literally, and a lone `-` is 
still a literal search. The parameter descriptions and the "Filtering with 
pattern parameters" section of the API description document it.
   - Behavior change to note: in the Dag display name search, a term like 
`-foo` used to search for the literal text `-foo`; it now excludes `foo`.
   
   **Screenshots** (example Dags: 123 total, 115 tagged `example`)
   
   "Exclude Tags" in the add filter menu:
   
   ![add filter 
menu](https://raw.githubusercontent.com/seunggabi/pr-airflow/pr-assets/dag-list-exclude/add_filter.png)
   
   `exclude_tags=example` → 8 Dags:
   
   ![exclude 
tags](https://raw.githubusercontent.com/seunggabi/pr-airflow/pr-assets/dag-list-exclude/exclude_tags.png)
   
   Searching `-example` → 65 Dags (the 58 whose name starts with `example` are 
hidden):
   
   ![search 
exclusion](https://raw.githubusercontent.com/seunggabi/pr-airflow/pr-assets/dag-list-exclude/search_minus.png)
   
   **Tests**
   
   - API: `exclude_tags` alone / with an unknown tag / combined with `tags`; 
`-` exclusions for both the substring and the prefix search, combined with `|`, 
a lone `-`, and a check that `dag_id_pattern` (not opted in) still treats `-` 
literally.
   - UI: `exclude_tags` from the URL is sent with the Dag list request and 
shown as a filter pill; the filter is offered in the "add filter" menu.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to