Skip to content
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
Feb 11, 2019
f444b92
Add whatsnew
Feb 11, 2019
6994e77
Address failures
Feb 11, 2019
f02e669
isort
Feb 11, 2019
807a1f8
Add comment and move test
Feb 11, 2019
71b093e
lint
Feb 11, 2019
d48c0db
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 11, 2019
3bda5fa
Add test with mixed timestamp:string slice
Feb 11, 2019
c10bcff
Don't check if one end is None
Feb 12, 2019
6363f05
Be explicity with endpoints to check
Feb 12, 2019
9678ebb
Add datetime args in test
Feb 12, 2019
b24b773
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 12, 2019
77e1e4d
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 13, 2019
44ed2a4
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 14, 2019
c16e0cd
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 14, 2019
0ef291c
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 15, 2019
0a272a9
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 16, 2019
200cdbf
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 16, 2019
ea339b6
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 17, 2019
ed96516
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 19, 2019
6ac4598
Document change in own section and timeseries.rst
Feb 20, 2019
a99d9c4
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 20, 2019
6d66371
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 20, 2019
138ac7c
add versionadded tag to timeseries.rst
Feb 20, 2019
e0e3e25
Merge remote-tracking branch 'upstream/master' into datestring_offset…
Feb 21, 2019
bb4814a
fix formatting
Feb 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't check if one end is None
  • Loading branch information
Matt Roeschke committed Feb 12, 2019
commit c10bcff9c507d6b5f80e3b6396c74a599eb80934
18 changes: 10 additions & 8 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this?
I often do DataFrame.truncate where one argument might be Europe/London and the second might be UTC! This used to work fine (and honestly, why shouldn't it?).

"same UTC offset")

start_slice = None
if start is not None:
Expand Down