-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: parametrize/de-duplicate arithmetic tests #44962
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
jbrockmendel
commented
Dec 18, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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.
lgtm some commments for followup
with warnings.catch_warnings(): | ||
warnings.simplefilter("ignore", DeprecationWarning) | ||
# The constructor validation can lead to a DeprecationWarning | ||
# from numpy, e.g. with RangeIndex + np.datetime64("now") |
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.
umm shouldn't we do something about this? (e.g. cast to object)
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, turns out to be pretty easy, will handle before long
for scalar in [pd.offsets.Hour(5), np.timedelta64(5, "h"), timedelta(hours=5)]: | ||
offset = dates + scalar | ||
tm.assert_equal(offset, expected) | ||
offset = scalar + dates | ||
tm.assert_equal(offset, expected) | ||
|
||
roundtrip = offset - scalar |
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.
prob should split this to a separate test & parameterize (followup)