-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
COMPAT: NaT accessors #15782
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
COMPAT: NaT accessors #15782
Conversation
for field in self._bool_accessors: | ||
|
||
result = getattr(NaT, field) | ||
assert not result |
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.
assert result is False
In the bare assert style for pytest, I find that a bit clearer if you are explicitly testing for False, and in this case, more importantly, otherwise 0 would pass the test (eg if for some reason the result if converted to float which is what happens in the current code)
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.
yep fixed
bcb3d20
to
4f4aff2
Compare
Codecov Report
@@ Coverage Diff @@
## master #15782 +/- ##
==========================================
- Coverage 90.99% 90.98% -0.02%
==========================================
Files 143 143
Lines 49386 49401 +15
==========================================
+ Hits 44939 44946 +7
- Misses 4447 4455 +8
Continue to review full report at Codecov.
|
any comments? |
TST: add pandas/tests/scalar/test_nat TST: revise testing of tseries accessors closes pandas-dev#15781
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.
Looks good!
TST: add pandas/tests/scalar/test_nat TST: revise testing of tseries accessors closes pandas-dev#15781
closes #15781
PR
0.19.2
mimics
is_leap_year
to return a boolean (inlcuding forNaT
).