-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
BUG: Indexing with UTC offset string no longer ignored #25263
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
jreback
merged 26 commits into
pandas-dev:master
from
mroeschke:datestring_offset_indexing
Feb 24, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d2716fd
BUG: Indexing with UTC offset string not longer ignored
f444b92
Add whatsnew
6994e77
Address failures
f02e669
isort
807a1f8
Add comment and move test
71b093e
lint
d48c0db
Merge remote-tracking branch 'upstream/master' into datestring_offset…
3bda5fa
Add test with mixed timestamp:string slice
c10bcff
Don't check if one end is None
6363f05
Be explicity with endpoints to check
9678ebb
Add datetime args in test
b24b773
Merge remote-tracking branch 'upstream/master' into datestring_offset…
77e1e4d
Merge remote-tracking branch 'upstream/master' into datestring_offset…
44ed2a4
Merge remote-tracking branch 'upstream/master' into datestring_offset…
c16e0cd
Merge remote-tracking branch 'upstream/master' into datestring_offset…
0ef291c
Merge remote-tracking branch 'upstream/master' into datestring_offset…
0a272a9
Merge remote-tracking branch 'upstream/master' into datestring_offset…
200cdbf
Merge remote-tracking branch 'upstream/master' into datestring_offset…
ea339b6
Merge remote-tracking branch 'upstream/master' into datestring_offset…
ed96516
Merge remote-tracking branch 'upstream/master' into datestring_offset…
6ac4598
Document change in own section and timeseries.rst
a99d9c4
Merge remote-tracking branch 'upstream/master' into datestring_offset…
6d66371
Merge remote-tracking branch 'upstream/master' into datestring_offset…
138ac7c
add versionadded tag to timeseries.rst
e0e3e25
Merge remote-tracking branch 'upstream/master' into datestring_offset…
bb4814a
fix formatting
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
Don't check if one end is None
- Loading branch information
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4869,14 +4869,16 @@ def slice_locs(self, start=None, end=None, step=None, kind=None): | |
|
|
||
| # GH 16785: If start and end happen to be date strings with UTC offsets | ||
| # attempt to parse and check that the offsets are the same | ||
| try: | ||
| ts_start = Timestamp(start) | ||
| ts_end = Timestamp(end) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| else: | ||
| if not tz_compare(ts_start.tzinfo, ts_end.tzinfo): | ||
| raise ValueError("Both dates must have the same UTC offset") | ||
| if start is not None and end is not None: | ||
| try: | ||
| ts_start = Timestamp(start) | ||
| ts_end = Timestamp(end) | ||
| except (ValueError, TypeError): | ||
| pass | ||
| else: | ||
| if not tz_compare(ts_start.tzinfo, ts_end.tzinfo): | ||
| raise ValueError("Both dates must have the " | ||
|
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. Why is this? |
||
| "same UTC offset") | ||
|
|
||
| start_slice = None | ||
| if start is not None: | ||
|
|
||
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.