-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix tzaware dates mismatch but no exception raised #18488
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
Fix tzaware dates mismatch but no exception raised #18488
Conversation
….tzinfo is not None
@@ -290,6 +290,24 @@ def test_precision_finer_than_offset(self): | |||
tm.assert_index_equal(result1, expected1) | |||
tm.assert_index_equal(result2, expected2) | |||
|
|||
def test_mismatching_tz_raises_err(self): | |||
dt1_tz = pd.Timestamp('2017-01-01', tz='US/Eastern') |
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.
add the issue number here as a comment
def test_mismatching_tz_raises_err(self): | ||
dt1_tz = pd.Timestamp('2017-01-01', tz='US/Eastern') | ||
dt1_no_tz = pd.Timestamp('2017-01-01') | ||
dt2_tz = pd.Timestamp('2017-01-04', tz='US/Eastern') |
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.
can you parametrize this test (IOW pass in start, end), cases for raising include:
- one naive, one with a tz & reversed
- different timezones & reversed
I don't think we care about the freq here.
Codecov Report
@@ Coverage Diff @@
## master #18488 +/- ##
==========================================
- Coverage 91.33% 91.32% -0.02%
==========================================
Files 163 163
Lines 49752 49752
==========================================
- Hits 45443 45436 -7
- Misses 4309 4316 +7
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18488 +/- ##
==========================================
- Coverage 91.33% 89.13% -2.21%
==========================================
Files 163 163
Lines 49752 49781 +29
==========================================
- Hits 45443 44370 -1073
- Misses 4309 5411 +1102
Continue to review full report at Codecov.
|
Updated tests |
@@ -290,6 +290,25 @@ def test_precision_finer_than_offset(self): | |||
tm.assert_index_equal(result1, expected1) | |||
tm.assert_index_equal(result2, expected2) | |||
|
|||
def test_mismatching_tz_raises_err(self): | |||
#issue 18488 |
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.
can use parametrize: http://pandas.pydata.org/pandas-docs/stable/contributing.html#using-pytest
Gotcha, using parametrize now |
lgtm. ping on green. |
@jreback all green :) |
thanks @aschade |
(cherry picked from commit d101064)
(cherry picked from commit d101064)
git diff upstream/master -u -- "*.py" | flake8 --diff