Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

kawochen
Copy link
Contributor

closes #12290

@jreback
Copy link
Contributor

jreback commented Feb 12, 2016

aha!

@jreback jreback added Bug Timezones Timezone data dtype labels Feb 12, 2016
@jreback jreback added this to the 0.18.0 milestone Feb 12, 2016
@@ -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):
Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Member

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.

@gfyoung
Copy link
Member

gfyoung commented Feb 12, 2016

@kawochen : Also, you should put "Closes gh-12306" in your commit message so that the issue gets automatically closed once the PR is merged.

@jreback
Copy link
Contributor

jreback commented Feb 12, 2016

the closes directive for the actual PR Is created at merge time

@kawochen
Copy link
Contributor Author

updated according to @gfyoung's comment

@jreback jreback closed this in 273bfb0 Feb 12, 2016
@jreback
Copy link
Contributor

jreback commented Feb 12, 2016

thanks @kawochen and @gfyoung

jreback added a commit that referenced this pull request Feb 13, 2016
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Computing time difference with timezone in Series with one row gives wrong result
3 participants