[x] I have searched the issues of this repo and believe that this is not a duplicate.
Linux + MacOS
pydantic-extra-types 2.8.1
pendulum 3.0.0
Issue
v2.8.1 has broken the timezone awareness of pendulum objects
In [1]: import pendulum
...: from pydantic_extra_types.pendulum_dt import DateTime as pet_DateTime
...: from pydantic import TypeAdapter
...:
...: pet_DateTime_adapter = TypeAdapter(pet_DateTime)
...:
...: p_dt = pendulum.parse("2024-06-01T15:56:16.829203-05:00")
...: pet_dt = pet_DateTime_adapter.validate_python("2024-06-01T15:56:16.829203-05:00")
In [2]: p_dt.tz, p_dt.tzinfo # What we expect with a straight pendulum DateTime
Out[2]: (FixedTimezone(-18000, name="-05:00"), FixedTimezone(-18000, name="-05:00"))
In [3]: pet_dt.tz, pet_dt.tzinfo # What we get instead with a pydantic-extra-types DateTime
Out[3]: (None, TzInfo(-05:00))
This has knock-on effects of breaking math that requires these tz values, typically losing timezone in the results.
In [4]: p_dt.subtract(days=1) # What we expect with a straight pendulum DateTime
Out[4]: DateTime(2024, 5, 31, 15, 56, 16, 829203, tzinfo=FixedTimezone(-18000, name="-05:00"))
In [5]: pet_dt.subtract(days=1) # What we get instead with a pydantic-extra-types DateTime
Out[5]: DateTime(2024, 5, 31, 15, 56, 16, 829203)
[x] I am on the latest Pendulum version.
[x] I have searched the issues of this repo and believe that this is not a duplicate.
Linux + MacOS
pydantic-extra-types 2.8.1
pendulum 3.0.0
Issue
v2.8.1 has broken the timezone awareness of pendulum objects
This has knock-on effects of breaking math that requires these tz values, typically losing timezone in the results.