You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/08/26 04:41:59 UTC
[PR] Fix mypy httpx/httpx2 type mismatch in anthropic provider tests [airflow]
jason810496 opened a new pull request, #72088:
URL: https://github.com/apache/airflow/pull/72088
I encountered the CI failure in non-related PR (https://github.com/apache/airflow/actions/runs/32921443404/job/98038017920?pr=71843)
## Why
`prek --stage manual mypy-providers --all-files` fails because `anthropic` 1.0.0 switched its HTTP transport dependency from `httpx` to a new, separate PyPI package named `httpx2`, so `BadRequestError`'s `response` parameter is now typed `httpx2.Response` instead of `httpx.Response`.
## What
- In `test_anthropic.py`'s `_make_bad_request` helper, added a scoped `# type: ignore[arg-type]` (with a comment) on the `BadRequestError(...)` call instead of importing `httpx2`. `BadRequestError` only ever duck-types the response object (`status_code`, `headers.get`, `.request`), so a plain `httpx.Response` still works at runtime. This avoids adding a hard dependency on `httpx2`, which doesn't exist under the provider's still-supported lower bound (`anthropic>=0.121.0`, which depends on `httpx`) and would otherwise break test collection under CI's lowest-direct-dependency job for providers.
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes, with help of Claude Code Sonnet 5 following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix mypy httpx/httpx2 type mismatch in anthropic provider tests [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on PR #72088:
URL: https://github.com/apache/airflow/pull/72088#issuecomment-5421828819
Close this one due to https://github.com/apache/airflow/pull/72072#pullrequestreview-5027616596. CI should be back to green now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix mypy httpx/httpx2 type mismatch in anthropic provider tests [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 closed pull request #72088: Fix mypy httpx/httpx2 type mismatch in anthropic provider tests
URL: https://github.com/apache/airflow/pull/72088
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix mypy httpx/httpx2 type mismatch in anthropic provider tests [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on PR #72088:
URL: https://github.com/apache/airflow/pull/72088#issuecomment-5421629342
As discussed with @amoghrajesh offline, it would be better to not limit the anthropic package version to avoid the dependencies conflicts, so I will merge this one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org