We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 920da19 commit c3ee0c3Copy full SHA for c3ee0c3
pandas/tests/groupby/test_groupby.py
@@ -1702,6 +1702,15 @@ def test_group_shift_with_fill_value():
1702
tm.assert_frame_equal(result, expected)
1703
1704
1705
+def test_group_shift_lose_timezone():
1706
+ # GH 30134
1707
+ now_dt = pd.Timestamp.utcnow()
1708
+ df = DataFrame({"a": [1, 1], "date": now_dt})
1709
+ result = df.groupby("a").shift(0).iloc[0]
1710
+ expected = Series({"date": now_dt}, name=result.name)
1711
+ tm.assert_series_equal(result, expected)
1712
+
1713
1714
def test_pivot_table_values_key_error():
1715
# This test is designed to replicate the error in issue #14938
1716
df = pd.DataFrame(
0 commit comments