Skip to content

Fix pending partition run lookups for slash keys and duplicate rows - #69700

Merged
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:fix-pending-partition-route
Jul 13, 2026
Merged

Fix pending partition run lookups for slash keys and duplicate rows#69700
bbovenzi merged 1 commit into
apache:mainfrom
astronomer:fix-pending-partition-route

Conversation

@Lee-W

@Lee-W Lee-W commented Jul 10, 2026

Copy link
Copy Markdown
Member

Why

  • Partition keys containing / returned 404 on the detail endpoint — the key was carried as a path segment, so the slash was interpreted as a route separator.
  • Duplicate pending AssetPartitionDagRun rows crashed the detail endpoint with a 500 (MultipleResultsFound from .one_or_none()).
  • Many-to-one non-rollup mappers over-reported progress on the detail view — received credit was uncapped, so it disagreed with the list view for the same partition.

What

  • Move partition_key from a path segment to a query parameter on the detail endpoint, so slash-containing keys round-trip correctly.
  • Take the latest pending row via order_by(id.desc()).limit(1) instead of .one_or_none(), matching the existing _get behavior in assets/manager.py` and the model docstring.
  • Cap non-rollup received credit at 1, aligning the detail with the list endpoint's _compute_received_count.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Slash-containing partition keys 404'd on the pending-partition-run detail
view, duplicate pending rows crashed it with a 500, and many-to-one
non-rollup mappers over-reported progress compared to the list view. This
fixes all three so partition progress in the UI is accurate and doesn't
error out.
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Jul 10, 2026
@Lee-W Lee-W self-assigned this Jul 13, 2026
@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 13, 2026
@bbovenzi
bbovenzi merged commit eb986f6 into apache:main Jul 13, 2026
98 checks passed
@bbovenzi
bbovenzi deleted the fix-pending-partition-route branch July 13, 2026 14:43
Lee-W added a commit that referenced this pull request Jul 14, 2026
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
…pache#69700)

Slash-containing partition keys 404'd on the pending-partition-run detail
view, duplicate pending rows crashed it with a 500, and many-to-one
non-rollup mappers over-reported progress compared to the list view. This
fixes all three so partition progress in the UI is accurate and doesn't
error out.
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 area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants