-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
move is_null_datetimelike to nattype for self-containment #21692
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
Codecov Report
@@ Coverage Diff @@
## master #21692 +/- ##
=======================================
Coverage 91.9% 91.9%
=======================================
Files 154 154
Lines 49659 49659
=======================================
Hits 45640 45640
Misses 4019 4019
Continue to review full report at Codecov.
|
pandas/_libs/missing.pxd
Outdated
@@ -1,6 +1,12 @@ | |||
# -*- coding: utf-8 -*- | |||
# cython: profile=False | |||
|
|||
cdef bint is_null_datetimelike(object val) | |||
from tslibs.nattype cimport is_null_datetimelike | |||
# pass-through so other modules can cimport is_null_datetimelike from 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.
why is this comment needed? this is for api simplicity yes? if so i don’t think really necessary for a comment
needs a rebase |
return True | ||
elif val is NaT: | ||
return True | ||
elif util.is_timedelta64_object(val): |
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.
why import this from util
? Didn't you move it to tslibs.missing
?
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.
Not sure I understand the question. This PR is moving this function from _libs.missing
to tslibs.nattype
because doing so simplifies the dependency structure.
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 by moving the function should not change the import?
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.
these util functions of basically c versions of isinstance checks, so this is ok.
thanks @jbrockmendel |
ATM
is_null_datetimelike
is used only intslibs.period
. The dependency structure is simplified nicely if we put that function istslibs.nattype
instead of in_libs.missing
.This also takes a couple of missing-themed functions out of inference.pyx
Finally, moves the libperiod block in setup.py to down with the rest of the tslibs blocks to restore alphabetical order.