-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix+Test Timedelta.__mul__(nan) #23342
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
Conversation
Hello @jbrockmendel! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #23342 +/- ##
=========================================
Coverage ? 92.22%
=========================================
Files ? 169
Lines ? 51217
Branches ? 0
=========================================
Hits ? 47236
Misses ? 3981
Partials ? 0
Continue to review full report at Codecov.
|
@@ -328,6 +336,16 @@ def test_td_div_numeric_scalar(self): | |||
assert isinstance(result, Timedelta) | |||
assert result == Timedelta(days=2) | |||
|
|||
@pytest.mark.parametrize('nan', [np.nan, np.float64('NaN'), float('nan')]) |
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.
nulls_fixture does this
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.
Yes, but it also includes several scalars we dont want to include here.
@@ -277,6 +277,14 @@ def test_td_mul_nat(self, op, td_nat): | |||
with pytest.raises(TypeError): | |||
op(td, td_nat) | |||
|
|||
@pytest.mark.parametrize('nan', [np.nan, np.float64('NaN'), float('nan')]) |
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.
same
thanks |
Specifically,
np.float64("NAN")
which in master gets caught by thehasattr(other, "dtype")
branch and incorrectly returnsnp.timedelta64("NaT", "ns")
instead ofNaT
git diff upstream/master -u -- "*.py" | flake8 --diff