Skip to content
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

Add tz param to to_datetime() when utc=True and errors='ignore' #23759

Closed
wants to merge 1 commit into from
Closed

Conversation

srinivasreddy
Copy link
Contributor

@srinivasreddy srinivasreddy commented Nov 18, 2018

@pep8speaks
Copy link

Hello @srinivasreddy! Thanks for submitting the PR.

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Thanks. Needs a test and whatsnew note.

@@ -212,7 +212,7 @@ def _convert_listlike_datetimes(arg, box, format, name=None, tz=None,
if box:
if errors == 'ignore':
from pandas import Index
return Index(result, name=name)
return Index(result, name=name, tz=tz)
Copy link
Member

Choose a reason for hiding this comment

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

While I think this works, we want to avoid passing this directly in the constructor.

Instead, if this line results in a DatetimeIndex, we want to use tz_localize(tz) instead.

@gfyoung gfyoung added Bug Datetime Datetime data dtype labels Nov 18, 2018
@mroeschke
Copy link
Member

@srinivasreddy do you mind updating and addressing the test failures from the CI?

@jreback
Copy link
Contributor

jreback commented Dec 23, 2018

closing as stale. if you want to continue pls ping.

@jreback jreback closed this Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: to_datetime with unit, utc=True and errors='ignore' does not coerce to UTC
5 participants