Skip to content

BUG: Return UTC DateTimeIndex when specified in to_datetime #12391

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

gfyoung
Copy link
Member

@gfyoung gfyoung commented Feb 19, 2016

Title is self-explanatory. Closes #11934.

@gfyoung
Copy link
Member Author

gfyoung commented Feb 19, 2016

  1. Will add "what's new" entry as soon as Travis gives me a green light.
  2. Where should I put a test for this bug? There is no test_tools.py file AFAICT.

@jreback
Copy link
Contributor

jreback commented Feb 19, 2016

tseries/test_timeseries

look for similar tests

@gfyoung gfyoung force-pushed the to_datetime_utc branch 2 times, most recently from 3ffc110 to 4c5228e Compare February 19, 2016 04:55
@gfyoung
Copy link
Member Author

gfyoung commented Feb 19, 2016

@jreback : All tests are passing. Should be good to merge then.

date_index = pd.to_datetime(df.index, utc=True)

expected = 'datetime64[ns, UTC]'
out_dtype = str(date_index.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construct an actual DatetimeIndex as the expect d result and use assert_index_equal

you don't need to construct the DataFrame here as you are only using the index

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jreback jreback added Bug Timezones Timezone data dtype labels Feb 19, 2016
@jreback jreback added this to the 0.18.0 milestone Feb 19, 2016
@gfyoung
Copy link
Member Author

gfyoung commented Feb 19, 2016

@jreback : All tests are passing. Should be good to merge then.

@jreback
Copy link
Contributor

jreback commented Feb 20, 2016

thanks!

@jreback jreback closed this in e39f63a Feb 20, 2016
@gfyoung gfyoung deleted the to_datetime_utc branch February 21, 2016 00:41
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.

2 participants