Skip to content

Commit

Permalink
Use CategoricalColumn instead of build_categorical_column (#4618)
Browse files Browse the repository at this point in the history
Over in cudf, I'm planning on removing `build_categorical_column` in favor of the `CategoricalColumn` constructor so adjusting the usage here

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Brad Rees (https://github.com/BradReesWork)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #4618
  • Loading branch information
mroeschke authored Aug 29, 2024
1 parent 0707fb4 commit 9b41aef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/cugraph/cugraph/structure/hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,16 @@ def _create_direct_edges(


def _str_scalar_to_category(size, val):
return cudf.core.column.build_categorical_column(
categories=cudf.core.column.as_column([val], dtype="str"),
codes=cudf.core.column.as_column(0, length=size, dtype=np.int32),
mask=None,
return cudf.core.column.CategoricalColumn(
data=None,
size=size,
dtype=cudf.CategoricalDtype(
categories=cudf.core.column.as_column([val], dtype="str"), ordered=False
),
mask=None,
offset=0,
null_count=0,
ordered=False,
children=(cudf.core.column.as_column(0, length=size, dtype=np.int32),),
)


Expand Down

0 comments on commit 9b41aef

Please sign in to comment.