diff --git a/narwhals/_dask/group_by.py b/narwhals/_dask/group_by.py index 2fbb4edb6..fd19699dd 100644 --- a/narwhals/_dask/group_by.py +++ b/narwhals/_dask/group_by.py @@ -51,7 +51,7 @@ def var( try: import dask.dataframe.dask_expr as dx - except ModuleNotFoundError: + except ModuleNotFoundError: # pragma: no cover import dask_expr as dx return partial(dx._groupby.GroupBy.var, ddof=ddof) @@ -67,7 +67,7 @@ def std( try: import dask.dataframe.dask_expr as dx except ModuleNotFoundError: - import dask_expr as dx + import dask_expr as dx # pragma: no cover return partial(dx._groupby.GroupBy.std, ddof=ddof) diff --git a/narwhals/_dask/utils.py b/narwhals/_dask/utils.py index cd303d8ec..d14383869 100644 --- a/narwhals/_dask/utils.py +++ b/narwhals/_dask/utils.py @@ -89,7 +89,7 @@ def add_row_index( def validate_comparand(lhs: dx.Series, rhs: dx.Series) -> None: try: import dask.dataframe.dask_expr as dx - except ModuleNotFoundError: + except ModuleNotFoundError: # pragma: no cover import dask_expr as dx if not dx._expr.are_co_aligned(lhs._expr, rhs._expr): # pragma: no cover diff --git a/narwhals/dependencies.py b/narwhals/dependencies.py index 43904a0ba..df671be3a 100644 --- a/narwhals/dependencies.py +++ b/narwhals/dependencies.py @@ -92,7 +92,7 @@ def get_ibis() -> Any: return sys.modules.get("ibis", None) -def get_dask_expr() -> Any: +def get_dask_expr() -> Any: # pragma: no cover """Get dask_expr module (if already imported - else return None).""" return sys.modules.get("dask_expr", None) diff --git a/tests/tpch_q1_test.py b/tests/tpch_q1_test.py index cb6d48548..498ed2349 100644 --- a/tests/tpch_q1_test.py +++ b/tests/tpch_q1_test.py @@ -31,7 +31,6 @@ def test_q1(library: str, request: pytest.FixtureRequest) -> None: df_raw = pl.scan_csv("tests/data/lineitem.csv") elif library == "dask": pytest.importorskip("dask") - pytest.importorskip("dask_expr", exc_type=ImportError) import dask.dataframe as dd df_raw = dd.from_pandas(