Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

fix: use model_copy instead of copy for pydantic 2 compatibility #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neubi4
Copy link

@neubi4 neubi4 commented Jul 11, 2023

In pydantic 2, copy of a model is deprecated, we should use model_copy instead.

Migration Guide: https://docs.pydantic.dev/2.0/migration/#migration-guide

Copy link

@msiwik-epruf msiwik-epruf left a comment

Choose a reason for hiding this comment

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

lgtm!

@rafalkrupinski
Copy link

For this it would be better to put in dependencies the maximum fastapi version that works with pydantic 1., and only apply this PR with the fastapi version that works with pydantic 2..

It's a breaking change, but since fastapi is on 0.* releases, anything goes

@wisdomtooth546
Copy link

wisdomtooth546 commented Sep 22, 2023

There are other instances where this copy() appears, such as InMemmoryBackend(), in the code so might want to update them as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants