Skip to content

API: Remove unreachable Accept branch and last deprecated 422 alias - #73463

Closed
Eason09053360 wants to merge 1 commit into
apache:mainfrom
Eason09053360:remove-dead-accept-branch-and-last-deprecated-422
Closed

Eason09053360 wants to merge 1 commit into
apache:mainfrom
Eason09053360:remove-dead-accept-branch-and-last-deprecated-422

Conversation

@Eason09053360

Copy link
Copy Markdown
Contributor

Why

Two unrelated-looking leftovers in api_fastapi, both cases of the code saying something untrue. The NDJSON branch of header_accept_json_or_ndjson_depends also tests for Mimetype.ANY, which the first branch has already returned for — read at face value it claims */* streams NDJSON, the opposite of what get_log documents and does. And api_fastapi/compat.py exists only to absorb Starlette's rename of HTTP_422_UNPROCESSABLE_ENTITY, but the asset events route landed two days after #69415 removed every other direct use, so it bypasses the shim: it warns on each malformed request and would turn a 422 into a 500 once Starlette drops the old name.

What

  • common/headers.py: drop the unreachable or accept.startswith(Mimetype.ANY). No behaviour change.
  • execution_api/routes/asset_events.py: take the 422 constant from api_fastapi.compat — the last direct use in the package.
  • Adds a test for the malformed-extra 422 path, which had none.

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

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

The NDJSON branch in header_accept_json_or_ndjson_depends also tested for
Mimetype.ANY, which the first branch has already returned for. Read at face
value it says "*/* streams NDJSON", the opposite of the documented behaviour
in get_log, so the next reader is misled and the condition can never be
covered.

api_fastapi/compat.py exists solely to paper over Starlette's rename of
HTTP_422_UNPROCESSABLE_ENTITY. The asset events route was added two days
after the cleanup that removed every other direct use, so it bypassed the
shim: it emits a StarletteDeprecationWarning on every malformed request and
would turn a 422 into a 500 once Starlette drops the old name. That path had
no test at all, so one is added along with it.
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Sep 21, 2026
@potiuk

potiuk commented Sep 25, 2026

Copy link
Copy Markdown
Member

Hello @Eason09053360 - thank you for your contributions to Apache Airflow!

The Airflow community has introduced a limit of 5 open pull requests at a time for contributors without write access to the repository. You currently have 33 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:

These pull requests stay open because maintainers are already engaged in them - they count towards your limit:

This is not a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.

What we ask you to do is to make your first prioritization decision: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or gh pr reopen <PR_NUMBER> --repo apache/airflow. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.

While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.

Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

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:task-sdk closed because of open PR limit Closed as a one-time step of introducing the open pull request limit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants