You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIRC, the intent is the annotating a field with pendulum_dt.Date will guarantee that the field will contain a pendulum.Date object (or in this case at least a subclass of it), so callers can be confident that pendulum's methods will be available on it. Currently (as of the recent release of v2.8.0, but also prior to that), that is not the behavior:
In [1]: frompydantic_extra_types.pendulum_dtimportDate; frompydanticimportTypeAdapter; adapter=TypeAdapter(Date)
In [2]: adapter.validate_python("1990-07-02T00:00:00.000+0000")
Out[2]: datetime.date(1990, 7, 2)
In [3]: adapter.validate_python("1990-07-02")
Out[3]: datetime.date(1990, 7, 2)
As you can see above, a standard datetime.date object is returned.
The text was updated successfully, but these errors were encountered:
IIRC, the intent is the annotating a field with
pendulum_dt.Date
will guarantee that the field will contain apendulum.Date
object (or in this case at least a subclass of it), so callers can be confident that pendulum's methods will be available on it. Currently (as of the recent release of v2.8.0, but also prior to that), that is not the behavior:As you can see above, a standard
datetime.date
object is returned.The text was updated successfully, but these errors were encountered: