-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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 TimedeltaIndex +/- offset array #19095
Conversation
After this we'll be able to get rid of _TimeOp entirely |
name=tdi.name, freq='infer') | ||
|
||
with tm.assert_produces_warning(PerformanceWarning): | ||
res = tdi + other |
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.
shouldn't you be using the box here?
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.
Good catch.
with tm.assert_produces_warning(PerformanceWarning): | ||
tdi + anchored | ||
with pytest.raises(TypeError): | ||
with tm.assert_produces_warning(PerformanceWarning): |
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.
some duplication here
with pytest.raises(TypeError): | ||
with tm.assert_produces_warning(PerformanceWarning): | ||
anchored + tdi | ||
|
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.
ideally could parameterize some of these for index, ndarray & Series as well (you can leave them here is ok). I believe you have some duplication in test_base
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.
Yah, part of it is tricky because parametrizing with box
and names
at the same time is cumbersome. My thought at the moment is to get the bugs fixed and tested first and take on refactoring later (when there's not a constant flow of rebasing to be done).
Codecov Report
@@ Coverage Diff @@
## master #19095 +/- ##
=========================================
Coverage ? 91.51%
=========================================
Files ? 148
Lines ? 48778
Branches ? 0
=========================================
Hits ? 44639
Misses ? 4139
Partials ? 0
Continue to review full report at Codecov.
|
@@ -25,26 +28,88 @@ def freq(request): | |||
return request.param | |||
|
|||
|
|||
def _raises_and_warns(op, left, right): |
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.
name things properly if you must do this: assert_raises_type_error_and_performance_warning.
yes its pretty long but its readable. remember folks who have no history with this code will be reading it and have no idea unless its spelled our.
Travis error is a timeout; should I re-push? |
i restarted |
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.
test comment, otherwise lgtm. ping when green.
expected_add = Series([tdi[n] + other[n] for n in range(len(tdi))], | ||
name=names[2]) | ||
|
||
with tm.assert_produces_warning(PerformanceWarning): |
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.
I would put a comment on before these sub-section of tests, hard to follow your flow others, IOW enumerate the cases. only looking for a comment at lines 89, 100, 107
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.
Will do.
Http error on appveyor |
Ping |
thanks! |
No issue specific to this, but analogus to #18849. There is a checkbox for this in #18824.
git diff upstream/master -u -- "*.py" | flake8 --diff