From 0e1f3457faf8fe01998c0c60e2368552c3851598 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Fri, 10 Jan 2025 10:40:46 +0100 Subject: [PATCH] n_unique returns_scalar=True --- narwhals/_spark_like/expr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/narwhals/_spark_like/expr.py b/narwhals/_spark_like/expr.py index 13e875d3d..fb8a69b93 100644 --- a/narwhals/_spark_like/expr.py +++ b/narwhals/_spark_like/expr.py @@ -488,7 +488,7 @@ def n_unique(self: Self) -> Self: def _n_unique(_input: Column) -> Column: return F.count_distinct(_input) + F.max(F.isnull(_input).cast(IntegerType())) - return self._from_call(_n_unique, "n_unique", returns_scalar=self._returns_scalar) + return self._from_call(_n_unique, "n_unique", returns_scalar=True) def is_null(self: Self) -> Self: from pyspark.sql import functions as F # noqa: N812