-
Notifications
You must be signed in to change notification settings - Fork 20
Migrate code to use Pydantic V2 #636
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
eb31438 to
1982137
Compare
Psycojoker
left a comment
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.
Apart from some questions, LGTM
b472e50 to
5d068b0
Compare
5d068b0 to
e4e3d1e
Compare
b5e05f1 to
bad782f
Compare
7cbfce6 to
ac9d738
Compare
bd9a9d6 to
88436b9
Compare
88436b9 to
ee28a85
Compare
1yam
left a comment
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.
Except the .model_dump_json() used on aiohttp.Client Response who is not a pydantic model.
Else LGTM
…yg_funct() It used fixture_instance_message.item_content instead of fixture_instance_message_payg.item_content so it raised some errors
…lues - Since it returns string after migrating to Pydantic2, converting the test values into strings
…the best way It raised some errors with mypy. So I checked the documentation to find a better way to serialize the datetime by using the decorator '@field_serializer'
Replacing every deprecated functions by new ones: - @validator → @field_validator - class Config → model_config = ConfigDict() - json_encoders → serialization - orm_mode → from_attributes - utcfromtimestamp() and pytz.utc.localize() → datetime.fromtimestamp(timestamp, tz=timezone.utc) - utcnow() → datetime.now(timezone.utc)
a8b272e to
805ef37
Compare
|
Closed in favour of #771 |
Related Clickup or Jira tickets : ALEPH-151
Self proofreading checklist
Changes
Used tool
bump-pydanticto migrate Pydantic V1 to Pydantic V2. Also added some manual modifications to fix orphan issues.How to test
Ensure that everything works as usual without issues.