Skip to content

Migrate airflow-core to httpx2 - #74244

Draft
zach-overflow wants to merge 10 commits into
apache:mainfrom
DataDog:zach.gottesman/core-migrate-to-httpx2
Draft

zach-overflow wants to merge 10 commits into
apache:mainfrom
DataDog:zach.gottesman/core-migrate-to-httpx2

Conversation

@zach-overflow

@zach-overflow zach-overflow commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What?

  • Migrates airflow-core's usage of httpx to httpx2, following the general migration guidance here.
  • Stacked off the related task-sdk migration PR (Migrate Task SDK to httpx2 #73116) since there is some code overlap.
  • Adds an ast-grep pre-commit check to prevent re-introducing httpx in the Task SDK, mirroring the providers one.

Why?

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

Code changes Generated-by: [Claude Code, Opus extra-high effort] following the guidelines

Self-reviewed and adjusted as needed by hand
PR description hand-written

Additional Notes

httpx has stalled: fixes that landed in httpx2 (a fork of httpx 0.28.1)
have not shipped upstream, and starlette has already migrated, so FastAPI
following is a matter of time. Moving the Execution API client now keeps
the SDK on a maintained HTTP stack.

Objects do not cross the httpx/httpx2 boundary, so the in-process
Execution API transports move with the client that consumes them; the
rest of airflow-core stays on httpx and migrates separately.

related: apache#70522
Compat tests pair the repo's devel-common helpers with a released Airflow
whose Task SDK is still on httpx. Pinning the helper to httpx2 hands those
clients a transport from the wrong package, and httpx rejects the response
stream it gets back.
Every other third-party hook in the repo pins an immutable SHA; a mutable
tag lets the hook change under CI without a diff.
Both HTTP stacks can coexist while compatibility jobs use older SDK
distributions. The migration needs regression coverage for its logging
behavior without exposing development-only helpers as public APIs.
Tests added on main for in-process shutdown still referenced httpx, which this branch no longer imports in the module.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider swapping httpx usage for httpx2

2 participants