Andrushika opened a new pull request, #73652: URL: https://github.com/apache/airflow/pull/73652
## Why `_choice_types()` in `providers/common/ai/.../utils/decision.py` imports `Choice` and `Choices` from pydantic-ai on first use, and falls back to `None` on versions before 2.46.0. pydantic-ai-slim 2.46.0 adds both names, so mypy now types the imported aliases as those classes and rejects the `None` fallback. The CI environment upgrade in #73629 bumps pydantic-ai-slim to 2.46.0, and its providers mypy check fails with 3 errors on this line. ## What Assign the `None` fallback to the module globals in `except`, and copy the imported types in `else`, so runtime behaviour does not change. CI on this PR still uses 2.44.0 and passes with or without the change, so I checked with mypy on `providers/common/ai` in breeze: the old code fails on 2.46.0, and this change passes on both 2.44.0 and 2.46.0. related: #73629 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5.5) Generated-by: Claude Code (Opus 5.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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
