| 182 | |
| 183 | |
| 184 | def test_rolling_raises(): |
| 185 | df = pd.DataFrame( |
| 186 | {"a": np.random.randn(25).cumsum(), "b": np.random.randint(100, size=(25,))} |
| 187 | ) |
| 188 | ddf = from_pandas(df, npartitions=2) |
| 189 | |
| 190 | pytest.raises(ValueError, lambda: ddf.rolling(1.5)) |
| 191 | pytest.raises(ValueError, lambda: ddf.rolling(-1)) |
| 192 | pytest.raises(ValueError, lambda: ddf.rolling(3, min_periods=1.2)) |
| 193 | pytest.raises(ValueError, lambda: ddf.rolling(3, min_periods=-2)) |
| 194 | pytest.raises(NotImplementedError, lambda: ddf.rolling(100).mean().compute()) |
| 195 | |
| 196 | |
| 197 | def test_time_rolling_constructor(df): |