We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bed37e7 commit 0d780feCopy full SHA for 0d780fe
pandas/tests/series/methods/test_diff.py
@@ -1,5 +1,6 @@
1
import numpy as np
2
import pytest
3
+import pandas as pd
4
5
from pandas import (
6
Series,
@@ -89,3 +90,12 @@ def test_diff_object_dtype(self):
89
90
result = ser.diff()
91
expected = ser - ser.shift(1)
92
tm.assert_series_equal(result, expected)
93
+
94
+def test_series_shift_rejects_prefix_suffix():
95
+ s = pd.Series([1, 2, 3])
96
97
+ with pytest.raises(ValueError, match="prefix.*DataFrame.shift"):
98
+ s.shift(1, prefix="PRE")
99
100
+ with pytest.raises(ValueError, match="suffix.*DataFrame.shift"):
101
+ s.shift(1, suffix="POST")
0 commit comments