diff --git a/dask_expr/_core.py b/dask_expr/_core.py index 62f648b8..76148faf 100644 --- a/dask_expr/_core.py +++ b/dask_expr/_core.py @@ -151,7 +151,7 @@ def operand(self, key): def dependencies(self): # Dependencies are `Expr` operands only - return [operand for operand in operands if isinstance(operand, Expr)] + return [operand for operand in self.operands if isinstance(operand, Expr)] def _task(self, index: int): """The task for the i'th partition diff --git a/dask_expr/tests/test_collection.py b/dask_expr/tests/test_collection.py index 4d869ca3..4d43e8d7 100644 --- a/dask_expr/tests/test_collection.py +++ b/dask_expr/tests/test_collection.py @@ -11,7 +11,7 @@ import dask.array as da import numpy as np import pytest -from dask.dataframe._compat import PANDAS_GE_210 +from dask.dataframe._compat import PANDAS_GE_210, PANDAS_GE_220 from dask.dataframe.utils import UNKNOWN_CATEGORIES from dask.utils import M @@ -1035,6 +1035,7 @@ def test_head_down(df): assert not isinstance(optimized.expr, expr.Head) +@pytest.mark.skipif(not PANDAS_GE_220, reason="not implemented") def test_case_when(pdf, df): result = df.x.case_when([(df.x.eq(1), 1), (df.y == 10, 2.5)]) expected = pdf.x.case_when([(pdf.x.eq(1), 1), (pdf.y == 10, 2.5)])