-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support for Optional types as X | None #399
Labels
bug
Something isn't working
Comments
Yes, this would be nice. |
This was referenced Apr 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to update my code to Odmantic 1.0.0, Pydantic 2.5.2 and also start using Python 3.11, but when I define one of my classes like this:
I'm getting this error:
How can I define the entity?
If I define it like this it works, but I'm using ruff and it automatically suggests the other format (and I personally prefer it):
I'm also having problems if instead of the email being of type
str
I useEmailStr
:In that case I get this error when I do
users = await self.engine.find(User)
:If I define it like this there are no errors:
The text was updated successfully, but these errors were encountered: