-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
check for datetime+period addition #18524
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
pandas/tests/scalar/test_period.py
Outdated
ts = pd.Timestamp('2017') | ||
per = pd.Period('2017', freq='M') | ||
|
||
with pytest.raises(TypeError): |
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.
Let's make sure that the right error message is hit (use tm.assert_raises_regex
to be safe, unclear ATM whether we're going to leverage the most recent pytest
API).
@jbrockmendel : Don't forget the |
Codecov Report
@@ Coverage Diff @@
## master #18524 +/- ##
==========================================
+ Coverage 91.32% 91.33% +<.01%
==========================================
Files 163 163
Lines 49798 49798
==========================================
+ Hits 45479 45483 +4
+ Misses 4319 4315 -4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18524 +/- ##
==========================================
+ Coverage 91.32% 91.33% +<.01%
==========================================
Files 163 164 +1
Lines 49798 49801 +3
==========================================
+ Hits 45479 45485 +6
+ Misses 4319 4316 -3
Continue to review full report at Codecov.
|
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.
needs a whatsnew note (0.22.0)
pandas/tests/scalar/test_period.py
Outdated
lbox(ts) + rbox(per) | ||
|
||
with pytest.raises(TypeError): | ||
lbox(per) + rbox(ts) |
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 a similar test with Series of periods & Timestamp; I think these are now in pandas/tests/series/test_timestamp.py IIRC (maybe make a test_period.py in series ok too).
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.
woops, just pushed without addressing this. Do you mean a Series that mixed, contains both Periods and Timestamps?
|
||
with tm.assert_raises_regex(TypeError, msg): | ||
lbox(per) + rbox(per) | ||
|
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 similar tests for sub
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.
OK for todo list? I'd like to keep this narrow, busy day ahead.
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.
ok
thanks! |
doesn't seem to fix: #18205 but maybe helps |
Unrelated. But that's high on my personal list, along with getting DateOffsets to be immutable. |
git diff upstream/master -u -- "*.py" | flake8 --diff