-
Notifications
You must be signed in to change notification settings - Fork 58
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
pendulum_dt: type object 'DateTime' has no attribute 'instance' #232
Comments
To reproduce: from pydantic import BaseModel
from pydantic_extra_types.pendulum_dt import Date, DateTime
class WithDate(BaseModel):
dt: DateTime
WithDate.model_validate({
"dt": "2024-10-30T01:00:30"
}) output:
|
@agriffin-grow. I faced a similar problem. Actually, in my case, pendulum was still not updated to version >=3. |
Make sure you're installing this library with the pendulum extras, otherwise it won't enforce pendulum >= 3 (which has the instance method). poetry add "pydantic-extra-types[pendulum]" |
oakhan3
pushed a commit
to oakhan3/pydantic-extra-types
that referenced
this issue
Oct 31, 2024
@samuelcolvin @yezz123 opened a pr for the readme if you think it would help |
yezz123
added a commit
that referenced
this issue
Jan 15, 2025
* Add additional installation information to README (#232) * 📝 Update README.md --------- Co-authored-by: Omar Ali Khan <[email protected]> Co-authored-by: Yasser Tahiri <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
instance()
appears to be a top level pendulum method and not available onDateTime
directlyIt looks like 1.5.1 is the last version that supported
DateTime.instance
, and this package depends on pendulum 3.0.0The text was updated successfully, but these errors were encountered: