8000 BUG: Retain timezone information in to_datetime if box=False by mroeschke · Pull Request #22457 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Retain timezone information in to_datetime if box=False #22457

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 3 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test and add issue number to whatsnew
  • Loading branch information
Matt Roeschke committed Aug 22, 2018
commit 975b6934aea7c1fa4d4025a0c499506ab195ae25
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ without timezone localization. This is inconsistent from parsing the same
datetime string with :class:`Timestamp` which would preserve the UTC
offset in the ``tz`` attribute. Now, :func:`to_datetime` preserves the UTC
offset in the ``tz`` attribute when all the datetime strings have the same
UTC offset (:issue:`17697`, :issue:`11736`)
UTC offset (:issue:`17697`, :issue:`11736`, :issue:`22457`)

*Previous Behavior*:

Expand Down
7 changes: 3 additions & 4 deletions pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,9 @@ def test_datetime64_dtype_array_returned(self):
'2015-01-01T00:00:00.000000000+0000'],
dtype='M8[ns]')

dt_index = pd.to_datetime(['2015-01-03T00:00:00.000000000+0000',
'2015-01-01T00:00:00.000000000+0000',
'2015-01-01T00:00:00.000000000+0000'],
box=False)
dt_index = pd.to_datetime(['2015-01-03T00:00:00.000000000',
'2015-01-01T00:00:00.000000000',
'2015-01-01T00:00:00.000000000'])
result = algos.unique(dt_index)
tm.assert_numpy_array_equal(result, expected)
assert result.dtype == expected.dtype
Expand Down
0