Skip to content

[v3-3-test] API: Fix prefix pattern search returning rows without the prefix - #73558

Merged
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-73520
Sep 23, 2026
Merged

pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-73520

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Backport of #73520 to v3-3-test.

Cherry-picked from 6036de1.

One conflict on airflow-core/src/airflow/api_fastapi/common/parameters/search.py imports: main added _RegexParam between v3-3-test's cutoff and now, which pulled in from fastapi import HTTPException, Query, status. v3-3-test has no _RegexParam and does not use HTTPException/status anywhere in this file. Resolved by keeping v3-3-test's from fastapi import Query and adding only func to the sqlalchemy import — that's the only new import the fix itself needs. The test file auto-merged cleanly.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

…che#73520)

The *_prefix_pattern filters turn a prefix into an index-friendly range
scan. Whenever bumping the last character would leave the alphanumeric
range ('9', 'z', 'Z'), the upper bound is recomputed from a shorter
prefix, so the scanned range is far wider than the prefix the caller
asked for: searching "dag_9" also returns "dag_abc", searching "a9"
returns everything starting with "a", and searching "z" gets no upper
bound at all. This affects every *_prefix_pattern query parameter, so a
UI search box and a REST client both get results that do not match what
was typed.

The documented trade-off of stripping trailing non-alphanumeric
characters is deliberate and stays; only the undocumented widening is
addressed here, and the bounds themselves are left alone so the B-tree
index still drives the scan.

Co-authored-by: Eason09053360 <[email protected]>
(cherry picked from commit 6036de1)
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Sep 22, 2026
@pierrejeambrun
pierrejeambrun merged commit 990f99d into apache:v3-3-test Sep 23, 2026
69 of 70 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-73520 branch September 23, 2026 11:14
@github-actions github-actions Bot added this to the Airflow 3.3.3 milestone Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.3 based on: bug fix merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants