-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[wip] Pydantic v2 #2751
Closed
benedikt-bartscher
wants to merge
52
commits into
reflex-dev:main
from
benedikt-bartscher:pydantic-v2
+2,706
−2,573
Closed
[wip] Pydantic v2 #2751
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
0b4b7c0
bump reflex_hosting_cli, pydantic and fastapi deps
benedikt-bartscher 25d0585
prepare base
benedikt-bartscher 8e692cd
state adjustments
benedikt-bartscher 95f9b12
types adjustments
benedikt-bartscher 8b2d0b4
outer_type_ -> annotation
benedikt-bartscher ce06bf0
migrate config to pydantic v2
benedikt-bartscher 67c8148
migrate remaining __fields__ to model_fields
benedikt-bartscher 66f1e21
fix backend vars
benedikt-bartscher fd32942
parse_obj is deprecated in favor of model_validate
benedikt-bartscher 6291c39
minor state fixes, and var serialization
benedikt-bartscher a5d197c
serialization fixes
benedikt-bartscher faebd22
black fixes
benedikt-bartscher 2def8b9
FieldInfo has no name anymore
benedikt-bartscher c057f2e
minor pydantic fixups
benedikt-bartscher 7f8a457
migrate to field.annotation and fix default var wrapping for undefined
benedikt-bartscher 5c584da
add missing default values to icon and link
benedikt-bartscher 1abc57c
fix default value for theme in ChakraProvider
benedikt-bartscher 4d497e0
hacky workaround to allow __class_getitem__ with pydantic
benedikt-bartscher 80a25d6
add missing type annotation for initialColorMode
benedikt-bartscher 8c7dd39
fix EventSpec args type annotation for pydantic v2
benedikt-bartscher 6d3809e
ModelField doesn't exist in pydantic v2
benedikt-bartscher 1c89f01
optionalize some Component props
benedikt-bartscher fd5a5b9
Bare.contents should be a Var
benedikt-bartscher d0f15c5
optionalize all Var props without defaults
benedikt-bartscher 78db90d
forgot to migrate one type_ to annotation
benedikt-bartscher 211f9f3
fix auto-var conversion
benedikt-bartscher 7789118
prevent calling __bool__ for is_hydrated
benedikt-bartscher 4380cd2
fix pydantic _get_value for MutableProxy
benedikt-bartscher 80f0275
add some missing type hints to test state vars
benedikt-bartscher 37c360e
fix init_subclass for pydantic v2, add some missing type hints, forma…
benedikt-bartscher 45cb36f
pydantic copy is deprecated in favor of model_copy
benedikt-bartscher b65c34b
update_forward_refs -> model_rebuild
benedikt-bartscher b565e89
dict -> model_dump and field_info fixes
benedikt-bartscher b359353
fix VarData json loads
benedikt-bartscher 0240541
migrate pydantic config classes to ConfigDict
benedikt-bartscher db3c791
add hint for VarData deserialization
benedikt-bartscher 32bc17b
minor IconButton default value fix
benedikt-bartscher 99c28f8
add proper pydantic v2 FieldInfo annotation
benedikt-bartscher 7534b2c
my regex was not smart enough
benedikt-bartscher 935286b
add Component.tag str type annotation
benedikt-bartscher f44d0ed
add Component.is_default bool type annotation
benedikt-bartscher 16b7bae
add Component.library str type annotation
benedikt-bartscher bcaab30
add Component.alias str type annotation
benedikt-bartscher 16b838d
format component.library black
benedikt-bartscher 3c30ceb
new regex missed f-strings
benedikt-bartscher bcd29a1
use typing.get_args instead of __args__
benedikt-bartscher 7ac184f
rebuild pydantic model after dropping id field
benedikt-bartscher 30df32b
add default value for new lang prop in Html
benedikt-bartscher be0a77a
pydantic_init_subclass
benedikt-bartscher 16a7c1f
fix bug in memoization mode copy
benedikt-bartscher 6d96a94
fix chakra list, allow Tag.tag to be None in validation
benedikt-bartscher cdc2f4f
cleanup unneeded init_subclass super calls
benedikt-bartscher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
forgot to migrate one type_ to annotation
commit 78db90d6953aaeea985ebc3bcafbd3b1cb6db118
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
in other places in the code
annotation
seems to be a function? 🤔 not sure if this is incorrect, but leaving myself a bookmark with this commentThere 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.
Yeah,
cs_obj = field.annotation()
is there to initialize default values iirc. Maybe pydantic provides smth likeget_field_default
which handlesdefault
anddefault_factorys
for us?