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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force pydantic v1 for sqlmodel compatibility #3026

Merged
merged 4 commits into from Apr 11, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Apr 6, 2024

Thanks @TimChild for the inspiration 馃槃

Fix #3019

When importing sqlmodel, we need to fake like pydantic v2 is actually v1 for
compatibility with Reflex's rx.Base (which is still based on pydantic v1
BaseModel)

Inspired by #3019
Ensure the sqlmodel that Reflex uses is based on pydantic v1, even when
pydantic v2 is installed in the environment.
Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

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

sweet, nice hack - reflex-web is running for me with Pydantic 2 now!

@picklelo picklelo merged commit d7abcd4 into main Apr 11, 2024
46 checks passed
@masenf masenf deleted the masenf/sqlmodel-force-pydantic-v1 branch April 24, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pydantic v2 still not compatible with Reflex 0.4.6 loosened requirements?
2 participants