-
-
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
Conversation
8d904c9
to
db9807b
Compare
aha! |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be a fast path? If tz2
is a string it doesn't take this path.
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.
i don't think it's supposed to actually be a string
as _maybe_get_tz is called I think
but u can compare it to UTC
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.
@kawochen : Hmmm...that would certainly explain why I was having a hard time reproducing it. np.empty
produces unpredictable values for np.int64
and could easily produce the NPY_NAT
value. If all your tests pass, I'll close my PR.
db9807b
to
38bed4d
Compare
the closes directive for the actual PR Is created at merge time |
updated according to @gfyoung's comment |
closes #12217 xref #12306 which I think fixed Author: Jeff Reback <[email protected]> Closes #12316 from jreback/concat and squashes the following commits: 563b23b [Jeff Reback] TST: validation tests for concat of same timezones
closes #12290