-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Implement tslibs.__init__, move easy bits of tslib #21738
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 #21738 +/- ##
==========================================
+ Coverage 91.92% 91.92% +<.01%
==========================================
Files 158 159 +1
Lines 49705 49708 +3
==========================================
+ Hits 45693 45696 +3
Misses 4012 4012
Continue to review full report at Codecov.
|
# flake8: noqa | ||
|
||
from .conversion import normalize_date, localize_pydatetime, tz_convert_single | ||
from .nattype import NaT, iNaT |
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.
next PR should have a test that exercises what is in this API, name it test_api.py and check that the namespace is locked down)
@@ -1025,6 +1025,35 @@ cdef inline str _render_tstamp(int64_t val): | |||
# ---------------------------------------------------------------------- | |||
# Normalization | |||
|
|||
|
|||
def normalize_date(object dt): | |||
""" |
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.
we ought to fix these names (prob rename date_normalize) in future PR
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.
going to merge, but pls followup the comments in next PR
|
||
Returns | ||
------- | ||
normalized : datetime.datetime or Timestamp |
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.
add a raises section
Easy answers to where
tslib.ints_to_pytimedelta
andtslib.normalize_date
belong, so this moves those.Starts populating the
tslibs.__init__
namespace; leaves updating imports for later.Cleans up a couple of unnecessary imports elsewhere.