-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_timedelta fails on Int64 Series with null values #35582
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
BUG: to_timedelta fails on Int64 Series with null values #35582
Conversation
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.
comment re: test placement
otherwise lgtm
|
||
tm.assert_series_equal(result, expected) | ||
|
||
# IntegerArray Series with nulls |
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.
it looks like other tests for missing values are in
def test_to_timedelta_on_missing_values(self): |
so might want to move this part there
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.
Alternatively, I would maybe just put this new code in its own test (so a test specifically for passing nullable Int64 dtype data)
We'll need a release note. This can go in 1.1.1 I think. |
@@ -166,3 +166,15 @@ def test_to_timedelta_ignore_strings_unit(self): | |||
arr = np.array([1, 2, "error"], dtype=object) | |||
result = pd.to_timedelta(arr, unit="ns", errors="ignore") | |||
tm.assert_numpy_array_equal(result, arr) | |||
|
|||
def test_to_timedelta_nullable_int64_dtype(self): |
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 add the issue number as a comment here
thanks @egoddard |
@meeseeksdev backport to 1.1.x |
… with null values
… values (#35602) Co-authored-by: Eric Goddard <[email protected]>
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff