From e18caa1aaa51a84c724dd3653716998aafc13e8d Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:52:48 -0800 Subject: [PATCH] Handle empty case --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index 8588b8db5..ea07863a8 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -186,9 +186,7 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. result = as_column( - float("nan"), - length=len(self._res_index), - dtype="float64", + [float("nan")] * len(self._res_index), dtype="float64" ) scatter_map = as_column( range(len(self._res_index)), dtype="int32"