Skip to content

Commit

Permalink
old arrow, xfail for modin
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Oct 31, 2024
1 parent 0e9dced commit 6f220fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion narwhals/_arrow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Generator
from typing import Sequence

from narwhals.translate import to_py_scalar
from narwhals.utils import isinstance_or_issubclass

if TYPE_CHECKING:
Expand Down Expand Up @@ -463,6 +464,6 @@ def _rolling(

if num_valid >= min_periods:
valid_weights = weights_.slice(0, num_valid)
yield aggregate_function(valid_window, valid_weights)
yield to_py_scalar(aggregate_function(valid_window, valid_weights))
else:
yield None
2 changes: 1 addition & 1 deletion narwhals/_pandas_like/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def rolling_mean(
if weights is not None:
msg = (
"`weights` argument is not supported in `rolling_mean` for "
f"{self._implementation} backend."
"pandas-like backend."
)
raise NotImplementedError(msg)

Expand Down
4 changes: 2 additions & 2 deletions tests/expr_and_series/rolling_mean_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_weighted_rolling_mean_expr(constructor: Constructor) -> None:
NotImplementedError,
match=re.escape("`weights` argument is not supported in `rolling_mean`"),
)
if "pandas" in str(constructor) or "dask" in str(constructor)
if any(x in str(constructor) for x in ("pandas", "modin", "cudf", "dask"))
else does_not_raise()
)
df = nw.from_native(constructor(data_weighted))
Expand All @@ -82,7 +82,7 @@ def test_weighted_rolling_mean_series(constructor_eager: ConstructorEager) -> No
NotImplementedError,
match=re.escape("`weights` argument is not supported in `rolling_mean`"),
)
if "pandas" in str(constructor_eager)
if any(x in str(constructor_eager) for x in ("pandas", "modin", "cudf"))
else does_not_raise()
)
df = nw.from_native(constructor_eager(data_weighted), eager_only=True)
Expand Down

0 comments on commit 6f220fb

Please sign in to comment.