Skip to content

TST: Use (unused) window parameter of test_freq_window_not_implemented #54947

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
Show file tree
Hide file tree
Changes from 2 commits
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
4 changes: 3 additions & 1 deletion pandas/core/indexers/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ def get_window_bounds(
step: int | None = None,
) -> tuple[np.ndarray, np.ndarray]:
if step is not None:
raise NotImplementedError("step not implemented for variable offset window")
raise NotImplementedError(
"step is not supported with variable offset window"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep this message unchanged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

)
if num_values <= 0:
return np.empty(0, dtype="int64"), np.empty(0, dtype="int64")

Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/window/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ def test_freq_window_not_implemented(window):
np.arange(10),
index=date_range("2015-12-24", periods=10, freq="D"),
)
with pytest.raises(
NotImplementedError, match="step is not supported with frequency windows"
):
df.rolling("3D", step=3)
with pytest.raises(NotImplementedError, match="^step is not supported with"):
df.rolling(window, step=3).sum()


@pytest.mark.parametrize("agg", ["cov", "corr"])
Expand Down