-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
@@ -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"]) |
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 it just UTC that gets recognized? "GMT"? "UTC-3"?
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.
Recognizes UTC-3 but not GMT. I'll update with a parameterized test.
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.
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): |
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.
GH ref?
LGTM pending GH ref |
thanks @mroeschke |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff