Skip to content

Limit anthropic provider to anthropic SDK below 1.0.0 - #72072

Merged
amoghrajesh merged 1 commit into
apache:mainfrom
aws-mwaa:onikolas/cap-anthropic-below-1-0
Aug 26, 2026
Merged

amoghrajesh merged 1 commit into
apache:mainfrom
aws-mwaa:onikolas/cap-anthropic-below-1-0

Conversation

@o-nikolas

@o-nikolas o-nikolas commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

anthropic SDK 1.0.0 (released 2026-08-20) replaces httpx with httpx2 (pydantic's fork) and is a major release the provider has not been validated against. Once the automated CI environment upgrade (#72016) pulled anthropic==1.0.0 into uv.lock, "MyPy providers checks" started failing on every PR built on top of it:

providers/anthropic/tests/unit/anthropic/hooks/test_anthropic.py:287: error:
Argument "response" to "BadRequestError" has incompatible type
"httpx._models.Response"; expected "httpx2._models.Response"

This blocks unrelated PRs — first seen on the provider release PR #72069.

This PR caps the provider dependency to anthropic>=0.121.0,<1.0.0 (main dependency and the bedrock/vertex/aws extras) and regenerates uv.lock, which now resolves anthropic==0.125.0 back on classic httpx.
The migration to the 1.x SDK and removal of the cap is tracked in #72071.

Tested: prek run --from-ref upstream/main --to-ref HEAD --stage pre-commit passes; uv.lock verified to resolve anthropic==0.125.0 (httpx-based), which is the version the last green main canary MyPy run used.


Was generative AI tooling used to co-author this PR?
  • Yes — Kiro CLI (claude-fable-5)

Generated-by: Kiro CLI (claude-fable-5) following the guidelines

anthropic 1.0.0 replaces httpx with httpx2 and is a major release the
provider has not been validated against. Once the CI environment upgrade
pulled it into uv.lock, MyPy providers checks started failing on every
PR built on top of it, blocking unrelated work such as the provider
release PR apache#72069. Cap the dependency until the provider is migrated to
the 1.x SDK, tracked in apache#72071.
@o-nikolas
o-nikolas marked this pull request as ready for review August 25, 2026 21:45

@amoghrajesh amoghrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reposting from slack.

I just ran both SDK versions side by side to get past guessing which one to pick.

The provider is close to 1.x anthropic api. Everything our provider imports still exists in 1.0.0, including the beta managed-agents types, all 16 client call paths resolve, and the full unit suite passes: 204/204 against anthropic==1.0.0

The mypy failure is the only thing 1.0 breaks in our tree, and it is one test helper, because BadRequestError's response param went from httpx.Response to httpx2.Response.

So type: ignore in #72088 is correct as far as it goes. I thought and my problem with landing only that: it clears the one loud symptom and leaves us floating into 1.x, and two issues are hiding which our tests dont catch today.

Bedrock and AWS region no longer self-resolves. get_conn passes aws_region=extras.get("aws_region"), so None when the extra is unset.

On 0.125 that warns and defaults to us-east-1. On 1.0 it raises ValueError. Our test mocks AnthropicBedrock, and the comment above it says "pass None so the SDK falls back to its own resolution", which is the exact assumption 1.0 removed. Existing Bedrock users relying on the default would break at runtime with a green test suite.

@amoghrajesh
amoghrajesh merged commit 6da46c4 into apache:main Aug 26, 2026
139 checks passed
rjgoyln added a commit to rjgoyln/airflow that referenced this pull request Aug 26, 2026
Picks up the anthropic SDK cap (apache#72072), which fixes the MyPy providers
check that was failing on every PR built on the previous main.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
anthropic 1.0.0 replaces httpx with httpx2 and is a major release the
provider has not been validated against. Once the CI environment upgrade
pulled it into uv.lock, MyPy providers checks started failing on every
PR built on top of it, blocking unrelated work such as the provider
release PR apache#72069. Cap the dependency until the provider is migrated to
the 1.x SDK, tracked in apache#72071.
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.

4 participants