-
Notifications
You must be signed in to change notification settings - Fork 783
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
use datetime.fold
to distinguish ambiguous datetimes when converting
#4791
Conversation
a87d9ae
to
0368ef0
Compare
We should probably do this for the IntoPyObject case as well. Current implementation will always set fold to 0. |
0c0c588
to
36be8a8
Compare
36be8a8
to
28999ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do this for the IntoPyObject case as well. Current implementation will always set fold to 0.
Thanks! Agreed. Implementation looks good to me. Perhaps we can add a round-trip test converting (non)ambiguous DateTime<Tz>
into Python, then extracting them back and make sure they are the same? What do you think?
Current test verifies this behaviour as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current test verifies this behaviour as well
Oops, I must have overlooked that part.
Great! Thanks for looking at my changes! |
#4791) * use `datetime.fold` to distinguish ambiguous datetimes when converting * Set correct fold when converting to ambiguous `chrono::DateTime<Tz>`
fixes #4722