Skip to content

Commit

Permalink
TST: DataFrameGroupBy.shift Loses TimeZone in datetime64 columns (pan…
Browse files Browse the repository at this point in the history
  • Loading branch information
tranctan authored and proost committed Dec 19, 2019
1 parent d738ac1 commit 3685fd5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,15 @@ def test_group_shift_with_fill_value():
tm.assert_frame_equal(result, expected)


def test_group_shift_lose_timezone():
# GH 30134
now_dt = pd.Timestamp.utcnow()
df = DataFrame({"a": [1, 1], "date": now_dt})
result = df.groupby("a").shift(0).iloc[0]
expected = Series({"date": now_dt}, name=result.name)
tm.assert_series_equal(result, expected)


def test_pivot_table_values_key_error():
# This test is designed to replicate the error in issue #14938
df = pd.DataFrame(
Expand Down

0 comments on commit 3685fd5

Please sign in to comment.