-
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.
chore: split eager-only and eager+lazy tests a bit (#652)
- Loading branch information
1 parent
946d9d7
commit d70e0b3
Showing
47 changed files
with
412 additions
and
220 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
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
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 |
---|---|---|
@@ -1,20 +1,28 @@ | ||
from typing import Any | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
import narwhals.stable.v1 as nw | ||
from tests.utils import compare_dicts | ||
|
||
|
||
@pytest.mark.parametrize("col_expr", [np.array([False, False, True]), nw.col("a"), "a"]) | ||
def test_allh(constructor: Any, col_expr: Any) -> None: | ||
def test_allh(constructor_lazy: Any) -> None: | ||
data = { | ||
"a": [False, False, True], | ||
"b": [False, True, True], | ||
} | ||
df = nw.from_native(constructor_lazy(data)) | ||
result = df.select(all=nw.all_horizontal(nw.col("a"), nw.col("b"))) | ||
|
||
expected = {"all": [False, False, True]} | ||
compare_dicts(result, expected) | ||
|
||
|
||
def test_allh_series(constructor: Any) -> None: | ||
data = { | ||
"a": [False, False, True], | ||
"b": [False, True, True], | ||
} | ||
df = nw.from_native(constructor(data), eager_only=True) | ||
result = df.select(all=nw.all_horizontal(col_expr, nw.col("b"))) | ||
result = df.select(all=nw.all_horizontal(df["a"], df["b"])) | ||
|
||
expected = {"all": [False, False, True]} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
from typing import Any | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
import narwhals.stable.v1 as nw | ||
from tests.utils import compare_dicts | ||
|
||
|
||
@pytest.mark.parametrize("col_expr", [np.array([False, False, True]), nw.col("a"), "a"]) | ||
def test_anyh(constructor: Any, col_expr: Any) -> None: | ||
def test_anyh(constructor_lazy: Any) -> None: | ||
data = { | ||
"a": [False, False, True], | ||
"b": [False, True, True], | ||
} | ||
df = nw.from_native(constructor(data), eager_only=True) | ||
result = df.select(any=nw.any_horizontal(col_expr, nw.col("b"))) | ||
df = nw.from_native(constructor_lazy(data)) | ||
result = df.select(any=nw.any_horizontal(nw.col("a"), nw.col("b"))) | ||
|
||
expected = {"any": [False, True, True]} | ||
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
Oops, something went wrong.