Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Adding v1 / v2 incompatibility warning for nested v1 model#10431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cloudflare-workers-and-pagesbot commentedSep 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Deploying pydantic-docs with |
Latest commit: | 8f9599f |
Status: | ✅ Deploy successful! |
Preview URL: | https://3c809738.pydantic-docs.pages.dev |
Branch Preview URL: | https://incompat-warning.pydantic-docs.pages.dev |
codspeed-hqbot commentedSep 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
CodSpeed Performance ReportMerging#10431 willnot alter performanceComparing Summary
|
github-actionsbot commentedSep 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
Uh oh!
There was an error while loading.Please reload this page.
if issubclass(obj, BaseModelV1): | ||
warn( | ||
f'Nesting V1 models inside V2 models is not supported. Please upgrade `{obj.__name__}` to V2.', | ||
UserWarning, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This will warn when doing the following:
frompydanticimportTypeAdapterfrompydantic.v1importBaseModelasBaseModelV1TypeAdapter(BaseModelV1)
So maybe there's a way to check for the current model stack before warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hmm, we don't supportTypeAdapter
with v1 models anyways... so maybe I should just make the warning more broad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've modified the warning accordingly
fbfcc60
intomainUh oh!
There was an error while loading.Please reload this page.
Contributing to#10314