From cfcd6533252c92a2d22dd4702c25c3a3788024b9 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Sun, 28 Jul 2024 14:57:54 +0100 Subject: [PATCH] chore: enable more lazy tests (#658) --- tests/test_group_by.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_group_by.py b/tests/test_group_by.py index 388d6a69b..6f16860ef 100644 --- a/tests/test_group_by.py +++ b/tests/test_group_by.py @@ -95,9 +95,9 @@ def test_group_by_empty_result_pandas() -> None: ) -def test_group_by_simple_named(constructor_eager: Any) -> None: +def test_group_by_simple_named(constructor: Any) -> None: data = {"a": [1, 1, 2], "b": [4, 5, 6], "c": [7, 2, 1]} - df = nw.from_native(constructor_eager(data), eager_only=True) + df = nw.from_native(constructor(data)) result = ( df.group_by("a") .agg( @@ -114,9 +114,9 @@ def test_group_by_simple_named(constructor_eager: Any) -> None: compare_dicts(result, expected) -def test_group_by_simple_unnamed(constructor_eager: Any) -> None: +def test_group_by_simple_unnamed(constructor: Any) -> None: data = {"a": [1, 1, 2], "b": [4, 5, 6], "c": [7, 2, 1]} - df = nw.from_native(constructor_eager(data), eager_only=True) + df = nw.from_native(constructor(data)) result = ( df.group_by("a") .agg( @@ -133,9 +133,9 @@ def test_group_by_simple_unnamed(constructor_eager: Any) -> None: compare_dicts(result, expected) -def test_group_by_multiple_keys(constructor_eager: Any) -> None: +def test_group_by_multiple_keys(constructor: Any) -> None: data = {"a": [1, 1, 2], "b": [4, 4, 6], "c": [7, 2, 1]} - df = nw.from_native(constructor_eager(data), eager_only=True) + df = nw.from_native(constructor(data)) result = ( df.group_by("a", "b") .agg( @@ -153,14 +153,14 @@ def test_group_by_multiple_keys(constructor_eager: Any) -> None: compare_dicts(result, expected) -def test_key_with_nulls(constructor_eager: Any, request: Any) -> None: - if "modin" in str(constructor_eager): +def test_key_with_nulls(constructor: Any, request: Any) -> None: + if "modin" in str(constructor): # TODO(unassigned): Modin flaky here? request.applymarker(pytest.mark.skip) context = ( pytest.raises(NotImplementedError, match="null values") if ( - "pandas_constructor" in str(constructor_eager) + "pandas_constructor" in str(constructor) and parse_version(pd.__version__) < parse_version("1.0.0") ) else nullcontext() @@ -168,7 +168,7 @@ def test_key_with_nulls(constructor_eager: Any, request: Any) -> None: data = {"b": [4, 5, None], "a": [1, 2, 3]} with context: result = ( - nw.from_native(constructor_eager(data)) + nw.from_native(constructor(data)) .group_by("b") .agg(nw.len(), nw.col("a").min()) .sort("a")