Skip to content

fix bad-argument-type on Annotated pydantic fields with custom schema #2586#3798

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:2586
Open

fix bad-argument-type on Annotated pydantic fields with custom schema #2586#3798
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:2586

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Summary

Fixes #2586

Annotated Pydantic fields detect metadata objects with a static __get_pydantic_core_schema__ hook and widen that field’s synthesized __init__ parameter to explicit Any.

Added the hook name constant.

Test Plan

add test

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

bad-argument-type on Annotated pydantic fields with custom schema

1 participant