-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: GH12290 where tz_convert used values of uninitialized arrays #12306
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3530,7 +3530,7 @@ def tz_convert(ndarray[int64_t] vals, object tz1, object tz2): | |
if _get_zone(tz2) == 'UTC': | ||
return utc_dates | ||
|
||
result = np.empty(n, dtype=np.int64) | ||
result = np.zeros(n, dtype=np.int64) | ||
if _is_tzlocal(tz2): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be a fast path? If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think it's supposed to actually be a string but u can compare it to UTC There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kawochen : Hmmm...that would certainly explain why I was having a hard time reproducing it. |
||
for i in range(n): | ||
v = utc_dates[i] | ||
|
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.
For completeness, you should also add the reverse
s2 - s1
and check that that returns the desired result ofTimedelta('-2days')