-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Added regression test #31538
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
Merged
Merged
TST: Added regression test #31538
Changes from 5 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
aa5dc3b
TST: Added regression test
270dfee
Flake8 issues
5691066
Update pandas/tests/frame/test_timeseries.py
ShaharNaveh 2cf0756
Moved the test case
33e24a3
Refactored the test case to use 'box_with_array'
bc75e25
Changed test name
20ba781
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
94cedb9
Added the add operations
1cafb66
Added time scalar to "other"
a5608eb
Lint
fd04076
Ignoring warnings, that we are not checking for this specific test case
1d17645
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
c454822
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
faf90e1
Renamed test case
5cdd1d1
Added comment pointing to the appropiate issue
6fef7f8
Added tz_naive_fixture
799ae78
Putting each expression in its own `pytest.raises`
54ea5a0
Fixed tests to pass
808599b
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
0db9073
Removed unneeded comments
d62cad3
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
1449d8c
Renamed test case
c5dc76c
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
6d2e72f
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
5742c46
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
951074f
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
fbce136
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
5954709
Fixed error message
f51559f
Fixed error message
e183a23
Merge remote-tracking branch 'upstream/master' into TST-reg-datetime
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Arithmetic tests for DataFrame/Series/Index/Array classes that should | ||
# behave identically. | ||
# Specifically for datetime64 and datetime64tz dtypes | ||
from datetime import datetime, timedelta | ||
from datetime import datetime, timedelta, time | ||
from itertools import product, starmap | ||
import operator | ||
import warnings | ||
|
@@ -1056,6 +1056,22 @@ def test_dt64arr_add_sub_parr( | |
) | ||
assert_invalid_addsub_type(dtarr, parr, msg) | ||
|
||
def test_timestamp_and_time_dtype_raises(self, box_with_array): | ||
# https://github.com/pandas-dev/pandas/issues/10329 | ||
obj1 = pd.date_range("2012-01-01", periods=3) | ||
obj2 = [time(i, i, i) for i in range(3)] | ||
|
||
obj1 = tm.box_expected(obj1, box_with_array) | ||
obj2 = tm.box_expected(obj2, box_with_array) | ||
|
||
msg = ( | ||
"unsupported operand type\(s\) for -: " | ||
"'(Timestamp|DatetimeArray)' and 'datetime.time'" | ||
) | ||
|
||
with pytest.raises(TypeError, match=msg): | ||
obj1 - obj2 | ||
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. the reversed operation obj2 - obj1 should also raise right? How about the addition ops? |
||
|
||
|
||
class TestDatetime64DateOffsetArithmetic: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"and" -> "addsub"