-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bug: AttributeError: type object 'datetime.datetime' has no attribute 'datetime' #370
Comments
Also, facing this issue. As a new user to the library, this one was pretty brutal as it wasn't clear if I was simply getting the typing wrong. |
@noamsto and @kevgliss I want to preface by mentioning I am not a typing pro. Some of you may know why this happens, but just so everyone stumbling upon this is on the same page, this happens because deep down the class As far as I am aware, there is not really an easy (or no?, happy to be corrected) fix here that will satisfy users who do With the current implementation, you can either
@provinzkraut can probably give a better explanation 🙂 |
That's correct. There is, however, a way to, at least somewhat, nicely solve this: We need to never used stringised annotations in AA. That means all type hints that need resolving would be on the user, who has control over this (e.g. in Litestar with the That is, unfortunately, the only way to fundamentally solve this issue (that is until Python 3.14 comes out and ruins it again for everyone but that's a whole other story 🙂). |
@Alc-Alc |
@Alc-Alc |
Description
Since this PR #341 we had to lock advanced_alchemy to version 28.0.0
We get the following error even when running
litestar
cli.Logs
Package Version
Platform
The text was updated successfully, but these errors were encountered: