Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uprev pydantic-core to 0.31.0 #5727

Merged
merged 7 commits into from
May 10, 2023
Merged

Uprev pydantic-core to 0.31.0 #5727

merged 7 commits into from
May 10, 2023

Conversation

adriangb
Copy link
Member

@adriangb adriangb commented May 10, 2023

  • Updates to computed_field: a return type is now required. It will be inferred from return type annotations
  • Replaces is_instance validators w/ json_or_python validators

Requires pydantic/pydantic-core#598 and pydantic/pydantic-core#599

All tests passing locally, will mark as ready for review once we cut the core release

Selected Reviewer: @dmontagu

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 10, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5678bdc
Status: ✅  Deploy successful!
Preview URL: https://ad6a0df5.pydantic-docs2.pages.dev
Branch Preview URL: https://uprev-core-again.pydantic-docs2.pages.dev

View logs

@@ -748,7 +746,7 @@ class ComputedFieldInfo:

decorator_repr: typing.ClassVar[str] = '@computed_field'
wrapped_property: property
json_return_type: _core_schema.JsonReturnTypes | None
return_type: type[Any]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay that we use Any below but type[Any] here? I can understand why you might do this, but just want to make sure it was intentional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reasoning was that type[Any] is technically incompatible if you try to assign int | str, but internally we pretty much want to treat it as a type, so type[Any] is more semantically meaningful

pydantic/fields.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@adriangb adriangb changed the title Uprev pydantic-core Uprev pydantic-core to 0.31.0 May 10, 2023
@adriangb adriangb marked this pull request as ready for review May 10, 2023 14:51
@adriangb
Copy link
Member Author

please review

@adriangb adriangb merged commit 4525911 into main May 10, 2023
42 checks passed
@adriangb adriangb deleted the uprev-core-again branch May 10, 2023 16:40
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.

None yet

3 participants