-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
move array_to_datetime timests #19640
Conversation
# test only the iso parser - flexibility to different | ||
# separators and leadings 0s | ||
# Timestamp construction falls back to dateutil | ||
cases = {'2011-01-02': datetime(2011, 1, 2), |
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 u parametrize
with pytest.raises(ValueError): | ||
tslib._test_parse_iso8601(date_str) | ||
# If no ValueError raised, let me know which case failed. | ||
raise Exception(date_str) |
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.
this is not necessary and the point off parametering
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 remove this except
Codecov Report
@@ Coverage Diff @@
## master #19640 +/- ##
==========================================
+ Coverage 91.58% 91.61% +0.02%
==========================================
Files 150 150
Lines 48807 48807
==========================================
+ Hits 44702 44714 +12
+ Misses 4105 4093 -12
Continue to review full report at Codecov.
|
with pytest.raises(ValueError): | ||
tslib._test_parse_iso8601(date_str) | ||
# If no ValueError raised, let me know which case failed. | ||
raise Exception(date_str) |
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 remove this except
result = tslib.array_to_datetime(arr, errors='ignore') | ||
tm.assert_numpy_array_equal(result, arr) | ||
|
||
@pytest.mark.parametrize('invalid_date', [date(1000, 1, 1), |
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.
pls format this
formatting by wrapping near the end of the line is rarely desired. |
Almost done.
With array_to_datetime there is some fuzziness in when a test is for array_to_datetime and when it is for to_datetime. I'm trying to specifically isolate tslibs tests, so for now am erring on the side of keeping to_datetime tests in test_tools.