From ec19d52f62782bf8a3af12ff30c7140a2bbe98e6 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 10 Jan 2025 09:51:18 -0800 Subject: [PATCH] cache null count for short circuit case --- python/cudf/cudf/_lib/column.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cudf/cudf/_lib/column.pyx b/python/cudf/cudf/_lib/column.pyx index cf7122fd15b..7e313d64789 100644 --- a/python/cudf/cudf/_lib/column.pyx +++ b/python/cudf/cudf/_lib/column.pyx @@ -346,7 +346,7 @@ cdef class Column: def null_count(self): if self._null_count is None: if not self.nullable or self.size == 0: - return 0 + self._null_count = 0 with acquire_spill_lock(): self._null_count = pylibcudf.null_mask.null_count( self.base_mask.get_ptr(mode="read"),