-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Implement _tz_convert_tzlocal_utc for de-duplication #21727
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
@@ -1205,7 +1187,6 @@ def is_date_array_normalized(ndarray[int64_t] stamps, tz=None): | |||
for i in range(n): | |||
# Adjust datetime64 timestamp, recompute datetimestruct | |||
pos = trans.searchsorted(stamps[i]) - 1 | |||
inf = tz._transition_info[pos] |
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.
unrelated to the rest of the PR
Codecov Report
@@ Coverage Diff @@
## master #21727 +/- ##
=======================================
Coverage 91.92% 91.92%
=======================================
Files 158 158
Lines 49705 49705
=======================================
Hits 45693 45693
Misses 4012 4012
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.
minor comments. prefer as a non-private, though if itsonly for this module then private is ok.
@@ -608,32 +608,33 @@ cpdef inline datetime localize_pydatetime(datetime dt, object tz): | |||
# ---------------------------------------------------------------------- | |||
# Timezone Conversion | |||
|
|||
cdef inline int64_t tz_convert_tzlocal_to_utc(int64_t val, tzinfo tz): | |||
cdef inline int64_t _tz_convert_tzlocal_utc(int64_t val, tzinfo tz, | |||
bint to_utc=True): |
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. can you add what this function does in doc-string. and mark as this is private.
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.
Mind if I put the docsting in the follow-up? There’s a couple more coming up in the next few hours.
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.
sure
Yes, the private function is just for this module. |
There is a bunch of code in conversion (and a bit in resolution, period, and tslib) that can be de-duplicated. This is one part of ~5 steps in that process.