-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add iso-format support to to_timedelta (#21877) #21933
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,10 @@ def check(value): | |
assert tup.microseconds == 999 | ||
assert tup.nanoseconds == 0 | ||
|
||
def test_iso_convertion(self): | ||
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. Minor typo of the word 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. Should I push a fix for it? 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. Go for it |
||
expected = Timedelta(1, unit='s') | ||
assert to_timedelta('P0DT0H0M1S') == expected | ||
|
||
def test_nat_converters(self): | ||
assert to_timedelta('nat', box=False).astype('int64') == iNaT | ||
assert to_timedelta('nan', box=False).astype('int64') == iNaT | ||
|
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.
Minor nit but we have a pseudo-standard of doing
tm.assert_index_equal(result, expected)
so would be nice to assign to a variable calledresult
in the line above and simply do the comparison on the last lineThere 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.
More importantly, you should reference the issue number in a comment beyond the function
def
line.Same applies to all tests that you have added.