From 71df8b4a06a47e58ad384050941d33f2239fa2f3 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Wed, 15 Jan 2025 13:26:23 +0100 Subject: [PATCH] generalize dask case --- narwhals/_dask/namespace.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/narwhals/_dask/namespace.py b/narwhals/_dask/namespace.py index 5284f46be..ed1a5bbbe 100644 --- a/narwhals/_dask/namespace.py +++ b/narwhals/_dask/namespace.py @@ -402,7 +402,8 @@ def __call__(self, df: DaskLazyFrame) -> Sequence[dx.Series]: try: then_expr = parse_into_expr(self._then_value, namespace=plx) value_series = then_expr(df)[0] - if getattr(then_expr, "_returns_scalar", False): # literal or reduction case + # literal or reduction case + if then_expr._returns_scalar: # type: ignore[attr-defined] _df = condition.to_frame("a") _df["tmp"] = value_series[0] value_series = _df["tmp"]