Skip to content

BUG: to_datetime with infer_datetime_format dropped timezone names #33133

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

Merged
merged 6 commits into from
Mar 31, 2020

Conversation

mroeschke
Copy link
Member

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@mroeschke mroeschke added Bug Timezones Timezone data dtype labels Mar 29, 2020
@mroeschke mroeschke added this to the 1.1 milestone Mar 29, 2020
@@ -1862,6 +1862,12 @@ def test_to_datetime_infer_datetime_format_series_start_with_nans(self, cache):
pd.to_datetime(s, infer_datetime_format=True, cache=cache),
)

def test_infer_datetime_format_tz_name(self):
s = pd.Series(["2019-02-02 08:07:13 UTC"])
Copy link
Member

Choose a reason for hiding this comment

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

is it just UTC that gets recognized? "GMT"? "UTC-3"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Recognizes UTC-3 but not GMT. I'll update with a parameterized test.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. @jbrockmendel merge when good.

@pytest.mark.parametrize(
"tz_name, offset", [("UTC", 0), ("UTC-3", 180), ("UTC+3", -180)]
)
def test_infer_datetime_format_tz_name(self, tz_name, offset):
Copy link
Member

Choose a reason for hiding this comment

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

GH ref?

@jbrockmendel
Copy link
Member

LGTM pending GH ref

@jreback jreback merged commit 6a8aca9 into pandas-dev:master Mar 31, 2020
@jreback
Copy link
Contributor

jreback commented Mar 31, 2020

thanks @mroeschke

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.

3 participants