Skip to content

Commit

Permalink
add dask diff method (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
raisadz authored Aug 15, 2024
1 parent cc01cae commit 166c49e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions narwhals/_dask/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ def clip(
returns_scalar=False,
)

def diff(self: Self) -> Self:
return self._from_call(
lambda _input: _input.diff(),
"diff",
returns_scalar=False,
)

def n_unique(self: Self) -> Self:
return self._from_call(
lambda _input: _input.nunique(dropna=False),
Expand Down
2 changes: 0 additions & 2 deletions tests/expr_and_series/diff_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@


def test_diff(constructor: Any, request: Any) -> None:
if "dask" in str(constructor):
request.applymarker(pytest.mark.xfail)
if "pyarrow_table_constructor" in str(constructor) and parse_version(
pa.__version__
) < (13,):
Expand Down

0 comments on commit 166c49e

Please sign in to comment.