seanghaeli opened a new pull request, #68859:
URL: https://github.com/apache/airflow/pull/68859
## Why
`MyPy providers checks` is currently **red on main** (and on every PR that
runs it). The most recent scheduled `main` canary fails with 4 errors, all in
`providers/amazon/.../aws/auth_manager/routes/login.py`:
```
login.py:104: error: Need type annotation for "form_data" [var-annotated]
login.py:104: error: Argument 1 to "run" has incompatible type
"def form(self, *, max_files=..., ...) ->
AwaitableOrContextManager[FormData]";
expected "Callable[[], Coroutine[Any, Any, Never]]"
login.py:154: (same two errors)
```
The `login.py` lines are unchanged since early 2025. What changed is #68560
("[main] Upgrade important CI environment"), which bumped **anyio 4.13.0 →
4.14.0**. anyio 4.14's stricter `from_thread.run` stub expects a zero-arg
`Callable[[], Coroutine[...]]`, but `request.form` is a method typed `(*,
max_files, ...) -> AwaitableOrContextManager[FormData]`, so mypy now rejects it.
## What
Wrap the call in a zero-arg `lambda` (so the argument is an unambiguous
`Callable[[], ...]`) and annotate the result as `FormData`. This clears both
the `[arg-type]` and `[var-annotated]` errors on both call sites. No runtime
behavior change: `from_thread.run` still ends up awaiting `request.form()`
exactly as before.
## Testing
`MyPy providers checks` should go green (it currently reproduces the 4
errors deterministically).
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes — Claude Code (Opus 4.8)
Generated-by: Claude Code (Opus 4.8) 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]