We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since i encountered this issue while re-implementing your serialization of time for beanie in python (BeanieODM/beanie#912)
there is issue when zone info can't get you precise utc offset without some date time (because of DST)
i know folowimg code this is pydantic... but what causes error is in here
pydantic-core/src/input/datetime.rs
Line 177 in e1fc99d
and here
Line 207 in e1fc99d
from pydantic import BaseModel from datetime import time from zoneinfo import ZoneInfo class TimeTest(BaseModel): t: time assert (TimeTest(t=time(12, 4, 5, 123456, tzinfo=ZoneInfo("America/Fortaleza"))) .model_dump(mode="json")) != (TimeTest(t=time(12, 4, 5, 123456, tzinfo=ZoneInfo("Europe/Prague"))) .model_dump(mode="json")) #fails
you can see it causes loss of data and is and there is way how to safely cover 99% of timezones (see my python implementation)
The text was updated successfully, but these errors were encountered:
Duplicate of pydantic/pydantic#9571 - thanks for reporting! 👍
Sorry, something went wrong.
samuelcolvin
No branches or pull requests
Since i encountered this issue while re-implementing your serialization of time for beanie in python (BeanieODM/beanie#912)
there is issue when zone info can't get you precise utc offset without some date time (because of DST)
i know folowimg code this is pydantic... but what causes error is in here
pydantic-core/src/input/datetime.rs
Line 177 in e1fc99d
and here
pydantic-core/src/input/datetime.rs
Line 207 in e1fc99d
you can see it causes loss of data and is and there is way how to safely cover 99% of timezones (see my python implementation)
The text was updated successfully, but these errors were encountered: