You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/05/12 14:51:42 UTC
[PR] Fix DAG owners filter matching unintended substrings [airflow]
1fanwang opened a new pull request, #66775:
URL: https://github.com/apache/airflow/pull/66775
Closes #42790.
`QueryOwnersFilter` (in `airflow-core/src/airflow/api_fastapi/common/parameters.py`) filters `DagModel.owners` with `ilike(f\"%{owner}%\")`. Because `DagModel.owners` is the comma-joined list of all task owners for a DAG, filtering for `Admin` returns DAGs whose owner is `NotAnAdmin` — `%Admin%` substring-matches anywhere in the joined string.
The fix normalises the column to `,owner1,owner2,...,owner_n,` with `func.replace` + `func.concat`, then ILIKEs against `'%,<owner>,%'`. Single ILIKE per term, cross-dialect (SQLite/Postgres/MySQL), index-friendly enough that the existing pagination plan doesn't regress.
Affects `GET /dags`, `GET /ui/dags`, and any endpoint sharing `QueryOwnersFilter`.
## Tests
- `airflow-core/tests/unit/api_fastapi/common/test_parameters.py::TestOwnersFilter` — compiles the statements and asserts the rendered SQL contains `'%,airflow,%'` rather than `'%airflow%'`.
- `airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py::TestGetDags` — parametrized integration cases including the canonical collision (filter `owner` against stored `test_owner,another_test_owner` returns 0 results; filter `another_test_owner` returns the DAG; multi-value OR works).
The new tests fail on `main` (wrong row counts under the substring predicate) and pass with this PR.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DAG owners filter matching unintended substrings [airflow]
Posted by "choo121600 (via GitHub)" <gi...@apache.org>.
choo121600 commented on PR #66775:
URL: https://github.com/apache/airflow/pull/66775#issuecomment-4440513206
@1fanwang Converting to **draft** — this PR doesn't yet meet our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
- :x: **Pre-commit / static checks** — Failing: `CI image checks / Static checks`. See [docs](https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst).
- :x: **Provider tests** — Failing: `provider distributions tests / Compat 3.0.6:P3.10:`. See [docs](https://github.com/apache/airflow/blob/main/contributing-docs/12_provider_distributions.rst).
- :x: **Other failing CI checks** — Failing: `Sqlite tests: core / DB-core:Sqlite:3.10:API...CLI`, `check-newsfragment-pr-number`. See [docs](https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst).
See the linked criteria for how to fix each item, then mark the PR "Ready for review". This is **not** a rejection — just an invitation to bring the PR up to standard. No rush.
---
_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](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated) so that our maintainers' limited time is spent where it matters most: the conversation with you._
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix DAG owners filter matching unintended substrings [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #66775: Fix DAG owners filter matching unintended substrings
URL: https://github.com/apache/airflow/pull/66775
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org