-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API/ENH: tz_localize handling of nonexistent times: rename keyword + add shift option #22644
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
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
bf5e7bf
ENH: Add handling of nonexistent times
36d13c7
Merge remote-tracking branch 'upstream/master' into normalize_tz
a5ea445
Merge remote-tracking branch 'upstream/master' into normalize_tz
8753d00
correct misspelling
e1a6c6a
Merge remote-tracking branch 'upstream/master' into normalize_tz
a7c86c8
Merge remote-tracking branch 'upstream/master' into normalize_tz
1884c7b
Merge remote-tracking branch 'upstream/master' into normalize_tz
a6a05df
change method of handling nonexistent times
c4dc8aa
Add another comment
1bc81db
Add tests for timestamps
c81d58c
Add tests for datetimeindex
b2c8429
Add series test and entry in timeseries.rst
a65987d
Add whatsnew
710014c
Clean up docstring
93159e5
Fix nat doc
a0ffcdd
Merge remote-tracking branch 'upstream/master' into normalize_tz
219256f
Merge remote-tracking branch 'upstream/master' into normalize_tz
d435481
Merge remote-tracking branch 'upstream/master' into normalize_tz
7c849b6
Merge remote-tracking branch 'upstream/master' into normalize_tz
56ac4fe
Merge remote-tracking branch 'upstream/master' into normalize_tz
b7b09bd
Merge remote-tracking branch 'upstream/master' into normalize_tz
94a72a5
add versionadded
39b769e
Remove whitespace
18664d8
Merge remote-tracking branch 'upstream/master' into normalize_tz
8852d43
Depreciate errors and see what needs warning captures
38b95e9
Correct NaT docstring
c88b0d8
edit whatsnew and check for raised DeprecationWarning
1bae682
Address review
d30f891
change default errors argument to None
f337692
Map depreciation correctly and test
6a12a7e
Merge remote-tracking branch 'upstream/master' into normalize_tz
a7b8357
Try to correctly test for FutureWarning
7ad87ec
Try adjusting catching FutureWarning
abad726
Merge remote-tracking branch 'upstream/master' into normalize_tz
6be1c25
Reorder context managers
f8be4b6
clear previously seen FutureWarning
c192c9f
separate test
8909f38
Merge remote-tracking branch 'upstream/master' into normalize_tz
49f203f
Merge remote-tracking branch 'upstream/master' into normalize_tz
01678c7
adjust test
707fdde
Merge remote-tracking branch 'upstream/master' into normalize_tz
ae27a50
Remove errors argument to tz_localize_to_utc
85ed25e
Merge remote-tracking branch 'upstream/master' into normalize_tz
9041ebe
Add nonexistent assert
a4cdac2
Handle default None arg
0a9c1db
Merge remote-tracking branch 'upstream/master' into normalize_tz
efb382e
Address review
61c73ca
Catch another warning
20cc925
Merge remote-tracking branch 'upstream/master' into normalize_tz
394a0db
Add extra docstring
a5253ee
Merge remote-tracking branch 'upstream/master' into normalize_tz
5185683
Edit whatsnew
ba1bfed
Merge remote-tracking branch 'upstream/master' into normalize_tz
8b06c96
Address comments
42ae923
Remove stacklevel
fe575fe
Add back check_stacklevel
3482f92
Add blank line for rendering
f0e43e2
Merge remote-tracking branch 'upstream/master' into normalize_tz
b98d4cf
Merge remote-tracking branch 'upstream/master' into normalize_tz
e6c5b2d
Validate nonexistent argument
83423ad
Merge remote-tracking branch 'upstream/master' into normalize_tz
1ca0ab2
Fix type
5bcc977
Merge remote-tracking branch 'upstream/master' into normalize_tz
8cf16e2
Merge remote-tracking branch 'upstream/master' into normalize_tz
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -564,14 +564,26 @@ class NaTType(_NaT): | |
- 'NaT' will return NaT for an ambiguous time | ||
- 'raise' will raise an AmbiguousTimeError for an ambiguous time | ||
|
||
errors : 'raise', 'coerce', default 'raise' | ||
nonexistent : 'shift', 'NaT', default 'raise' | ||
A nonexistent time does not exist in a particular timezone | ||
where clocks moved forward due to DST. | ||
|
||
- 'shift' will shift the nonexistent time forward to the closest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, rst formatting nitpick: there needs to be a blank line between the first sentences, and the start of this list ... (getting rst right can be annoying ..) |
||
existing time | ||
- 'NaT' will return NaT where there are nonexistent times | ||
jorisvandenbossche marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 'raise' will raise an NonExistentTimeError if there are | ||
nonexistent times | ||
|
||
.. versionadded:: 0.24.0 | ||
|
||
errors : 'raise', 'coerce', default None | ||
- 'raise' will raise a NonExistentTimeError if a timestamp is not | ||
valid in the specified timezone (e.g. due to a transition from | ||
or to DST time) | ||
or to DST time). Use ``nonexistent='raise'`` instead. | ||
- 'coerce' will return NaT if the timestamp can not be converted | ||
into the specified timezone | ||
into the specified timezone. Use ``nonexistent='NaT'`` instead. | ||
|
||
.. versionadded:: 0.19.0 | ||
.. deprecated:: 0.24.0 | ||
|
||
Returns | ||
------- | ||
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.