-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add experimental_allow_partial
support
#10748
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
Conversation
CodSpeed Performance ReportMerging #10748 will not alter performanceComparing Summary
|
Deploying pydantic-docs with
|
Latest commit: |
3ea36b0
|
Status: | ✅ Deploy successful! |
Preview URL: | https://ad0fa9a1.pydantic-docs.pages.dev |
Branch Preview URL: | https://allow-partial.pydantic-docs.pages.dev |
experimental_allow_partial
support to TypeAdapter
experimental_allow_partial
support
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 is super exciting overall - definitely a fan of the experimental_
prefix for now. I'm impressed with the turnaround here.
A few follow up questions:
- We should add a section to the
experimental
docs talking about this flag (happy to have this between the beta and official release) - I'm wondering, does it make sense to only have this as a runtime flag? Should we also have a config setting for this - we have one for
cache_strings
, which I believe has a similar flow down tojitter
? Even if not on config, I think we should make this accessible for fields in models, typed dicts, etc.
As a general note on the above, I feel we don't have a super clear system for when something belongs as a:
- Runtime flag
- Config setting
- Annotation
Field
setting
And we should probably document that to guide consistency in future development.
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.
1 files reviewed, 2 total issue(s) found.
The style guide flagged several spelling errors that seemed like false positives. We skipped posting inline suggestions for the following words:
- [Aa]nnotated_types
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.
The style guide flagged several spelling errors that seemed like false positives. We skipped posting inline suggestions for the following words:
- annotated_types
d01149c
to
cd1647b
Compare
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.
1 files reviewed, 3 total issue(s) found.
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.
1 files reviewed, 3 total issue(s) found.
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.
The style guide flagged several spelling errors that seemed like false positives. We skipped posting inline suggestions for the following words:
- jiter
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.
Amazing!
Thanks for including such thorough docs - those will be easy to move to the concepts section, eventually!
This relies on:
JsonValue
jiter#157allow_partial
pydantic-core#1512So far
allow_partial
support is only implemented on validators for the following types:list
set
frozenset
dict
(e.g.dict[X, Y]
)TypedDict
There are 2 fundamental things introduced:
[1, 2, "thr
Example: