Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Dec 12, 2024
1 parent e70a97c commit c43f364
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/awkward/contents/listoffsetarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ def _to_cudf(self, cudf: Any, mask: Content | None, length: int):
index = self._offsets.raw(cupy).astype("int32")
buf = cudf.core.buffer.as_buffer(index)

if parse_version(cupy._version.__version__) >= parse_version("24.10.00"):
if parse_version(cudf.__version__) >= parse_version("24.10.00"):
ind_buf = cudf.core.column.numerical.NumericalColumn(
data=buf, dtype=index.dtype, mask=None, size=len(index)
)
Expand All @@ -2042,13 +2042,21 @@ def _to_cudf(self, cudf: Any, mask: Content | None, length: int):
mask=m,
)

return cudf.core.column.lists.ListColumn(
size=length,
data=None,
mask=m,
children=(ind_buf, cont),
dtype=cudf.core.dtypes.ListDtype(cont.dtype),
)
if parse_version(cudf.__version__) >= parse_version("24.10.00"):
return cudf.core.column.lists.ListColumn(
size=length,
data=None,
mask=m,
children=(ind_buf, cont),
dtype=cudf.core.dtypes.ListDtype(cont.dtype),
)
else:
return cudf.core.column.lists.ListColumn(
length,
mask=m,
children=(ind_buf, cont),
dtype=cudf.core.dtypes.ListDtype(cont.dtype),
)

def _to_backend_array(self, allow_missing, backend):
array_param = self.parameter("__array__")
Expand Down

0 comments on commit c43f364

Please sign in to comment.