-
Notifications
You must be signed in to change notification settings - Fork 1
Add NonExistentTimeError Handling for Daylight Saving Time (DST) Transitions #48
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gustavo-batista
approved these changes
Dec 1, 2025
VinyPinheiro
approved these changes
Dec 1, 2025
davicedraz
approved these changes
Dec 1, 2025
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This PR fixes an issue where datetime nodes would fail when handling dates that fall into nonexistent or ambiguous time periods during daylight saving time (DST) transitions. When clocks spring forward or fall back, certain times either don't exist or are ambiguous, causing errors in pandas timezone operations.
Problem
When localizing or converting datetime values in timezones with DST, the
tz_localize()method would raise errors for:Solution
Added proper handling for nonexistent and ambiguous times by configuring the
tz_localize()method with appropriate parameters across all affected nodes:nonexistent="shift_forward": Automatically shifts nonexistent times to the next valid timeambiguous="NaT": Returns NaT (Not a Time) for ambiguous times, or handles them appropriately per node contextChanges Made
Modified Nodes
1. ToISOFormat
Updated the
convert_to_isointernal function to handle DST edge cases when converting string dates to ISO format.2. DifferenceBetweenDates
Updated the
replace_invalidinternal function to handle DST edge cases when localizing naive timestamps for date difference calculations.