Skip to content

Commit

Permalink
fix: Upstream API changes in cuDF 24.10 (scikit-hep#3328)
Browse files Browse the repository at this point in the history
This is an exact copy of PR scikit-hep#3309, which was closed in favor of this one (to avoid issues with the `rapidjson` submodule).
  • Loading branch information
jpivarski authored Dec 5, 2024
1 parent 661702b commit 8f69dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/awkward/contents/listoffsetarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,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)
ind_buf = cudf.core.column.numerical.NumericalColumn(
buf, index.dtype, None, size=len(index)
data=buf, dtype=index.dtype, mask=None, size=len(index)
)
cont = self._content._to_cudf(cudf, None, len(self._content))
if mask is not None:
Expand All @@ -2035,7 +2035,8 @@ def _to_cudf(self, cudf: Any, mask: Content | None, length: int):
)

return cudf.core.column.lists.ListColumn(
length,
size=length,
data=None,
mask=m,
children=(ind_buf, cont),
dtype=cudf.core.dtypes.ListDtype(cont.dtype),
Expand Down
3 changes: 3 additions & 0 deletions src/awkward/operations/ak_to_cudf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ def to_cudf(
"""
import cudf

if hasattr(cudf.Series, "_from_column"):
return cudf.Series._from_column(array.layout._to_cudf(cudf, None, len(array)))
# older Series invocation
return cudf.Series(array.layout._to_cudf(cudf, None, len(array)))

0 comments on commit 8f69dbf

Please sign in to comment.