From 5dd14ef342843c8088051612ffc20b97d56e69de Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:55:40 -1000 Subject: [PATCH] Add data=None to ListColumn constructor (#1442) Post https://github.com/rapidsai/cudf/pull/16465, the `data` argument to `ListColumn` is a required argument (as `None`) Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1442 --- python/cuspatial/cuspatial/core/_column/geocolumn.py | 11 ++++++++++- .../cuspatial/cuspatial/core/binops/intersection.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/_column/geocolumn.py b/python/cuspatial/cuspatial/core/_column/geocolumn.py index ca73822b5..52b9f3381 100644 --- a/python/cuspatial/cuspatial/core/_column/geocolumn.py +++ b/python/cuspatial/cuspatial/core/_column/geocolumn.py @@ -180,6 +180,7 @@ def _from_multipoints_xy( multi_elements = _xy_as_variable_sized_list(multipoints_xy) multipoint_col = ListColumn( + data=None, dtype=cudf.ListDtype(multi_elements.dtype), size=len(geometry_offsets) - 1, children=(geometry_offsets, multi_elements), @@ -235,11 +236,13 @@ def _from_linestrings_xy( parts_elements = _xy_as_variable_sized_list(linestrings_xy) parts_col = ListColumn( + data=None, dtype=cudf.ListDtype(parts_elements.dtype), size=len(part_offsets) - 1, children=(part_offsets, parts_elements), ) linestrings_col = ListColumn( + data=None, dtype=cudf.ListDtype(parts_col.dtype), size=len(geometry_offsets) - 1, children=(geometry_offsets, parts_col), @@ -296,16 +299,19 @@ def _from_polygons_xy( ring_elements = _xy_as_variable_sized_list(polygons_xy) rings_col = ListColumn( + data=None, dtype=cudf.ListDtype(ring_elements.dtype), size=len(ring_offsets) - 1, children=(ring_offsets, ring_elements), ) parts_col = ListColumn( + data=None, dtype=cudf.ListDtype(rings_col.dtype), size=len(part_offsets) - 1, children=(part_offsets, rings_col), ) polygons_col = ListColumn( + data=None, dtype=cudf.ListDtype(parts_col.dtype), size=len(geometry_offsets) - 1, children=(geometry_offsets, parts_col), @@ -369,5 +375,8 @@ def _xy_as_variable_sized_list(xy: ColumnBase): num_points = len(xy) // 2 indices = as_column(range(0, num_points * 2 + 1, 2), dtype="int32") return ListColumn( - dtype=cudf.ListDtype(xy.dtype), size=num_points, children=(indices, xy) + data=None, + dtype=cudf.ListDtype(xy.dtype), + size=num_points, + children=(indices, xy), ) diff --git a/python/cuspatial/cuspatial/core/binops/intersection.py b/python/cuspatial/cuspatial/core/binops/intersection.py index afc85956a..62eac4227 100644 --- a/python/cuspatial/cuspatial/core/binops/intersection.py +++ b/python/cuspatial/cuspatial/core/binops/intersection.py @@ -86,6 +86,7 @@ def pairwise_linestring_intersection( # Organize the look back ids into list column (lhs_linestring_id, lhs_segment_id, rhs_linestring_id, rhs_segment_id,) = [ ListColumn( + data=None, dtype=cudf.ListDtype(id_.dtype), size=len(geometry_collection_offset) - 1, children=(geometry_collection_offset, id_), @@ -94,6 +95,7 @@ def pairwise_linestring_intersection( ] linestring_column = ListColumn( + data=None, dtype=cudf.ListDtype(segments.dtype), size=segments.size, children=(