-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dask lazyframe remaining methods (#778)
* feat: dask dataframe remaining methods * gather_every in Expr
- Loading branch information
Showing
6 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
import pytest | ||
|
||
import narwhals as nw | ||
from tests.utils import compare_dicts | ||
|
||
|
||
@pytest.mark.parametrize("n", [2, -1]) | ||
def test_head(constructor: Any, n: int, request: Any) -> None: | ||
if "dask" in str(constructor): | ||
request.applymarker(pytest.mark.xfail) | ||
if "polars" in str(constructor) and n < 0: | ||
request.applymarker(pytest.mark.xfail) | ||
df = nw.from_native(constructor({"a": [1, 2, 3]})) | ||
result = df.select(nw.col("a").tail(n)) | ||
expected = {"a": [2, 3]} | ||
compare_dicts(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("n", [2, -1]) | ||
def test_head_series(constructor_eager: Any, n: int) -> None: | ||
df = nw.from_native(constructor_eager({"a": [1, 2, 3]}), eager_only=True) | ||
result = df.select(df["a"].tail(n)) | ||
expected = {"a": [2, 3]} | ||
compare_dicts(result, expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.