Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX] Updates cudf usage for compatibility with cudf>=23.10.1 #4007

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions python/cugraph/cugraph/structure/property_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,15 +800,9 @@ def add_vertex_data(
tmp_df.index = tmp_df.index.rename(self.vertex_col_name)

# FIXME: handle case of a type_name column already being in tmp_df
if self.__series_type is cudf.Series:
# cudf does not yet support initialization with a scalar
tmp_df[TCN] = cudf.Series(
cudf.Series([type_name], dtype=cat_dtype).repeat(len(tmp_df)),
index=tmp_df.index,
)
else:
# pandas is oddly slow if dtype is passed to the constructor here
tmp_df[TCN] = pd.Series(type_name, index=tmp_df.index).astype(cat_dtype)
tmp_df[TCN] = self.__series_type(type_name, index=tmp_df.index).astype(
cat_dtype
)

if property_columns:
# all columns
Expand Down Expand Up @@ -1207,15 +1201,9 @@ def add_edge_data(
tmp_df[self.src_col_name] = tmp_df[vertex_col_names[0]]
tmp_df[self.dst_col_name] = tmp_df[vertex_col_names[1]]

if self.__series_type is cudf.Series:
# cudf does not yet support initialization with a scalar
tmp_df[TCN] = cudf.Series(
cudf.Series([type_name], dtype=cat_dtype).repeat(len(tmp_df)),
index=tmp_df.index,
)
else:
# pandas is oddly slow if dtype is passed to the constructor here
tmp_df[TCN] = pd.Series(type_name, index=tmp_df.index).astype(cat_dtype)
tmp_df[TCN] = self.__series_type(type_name, index=tmp_df.index).astype(
cat_dtype
)

# Add unique edge IDs to the new rows. This is just a count for each
# row starting from the last edge ID value, with initial edge ID 0.
Expand Down
Loading