Skip to content

Commit

Permalink
remove deprecated call and add fixme
Browse files Browse the repository at this point in the history
  • Loading branch information
jnke2016 committed Mar 13, 2024
1 parent b3a9019 commit 6a44ca6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/cugraph/cugraph/sampling/node2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
# FIXME: Move this function to the utility module so that it can be
# shared by other algos
def ensure_valid_dtype(input_graph, start_vertices):
vertex_dtype = input_graph.edgelist.edgelist_df.dtypes[0]
vertex_dtype = input_graph.edgelist.edgelist_df.iloc[0]
if isinstance(start_vertices, cudf.Series):
start_vertices_dtypes = start_vertices.dtype
start_vertices_dtype = start_vertices.dtype
else:
start_vertices_dtypes = start_vertices.dtypes[0]
start_vertices_dtype = start_vertices.iloc[0]

if start_vertices_dtypes != vertex_dtype:
if start_vertices_dtype != vertex_dtype:
warning_msg = (
"Node2vec requires 'start_vertices' to match the graph's "
f"'vertex' type. input graph's vertex type is: {vertex_dtype} and got "
f"'start_vertices' of type: {start_vertices_dtypes}."
f"'start_vertices' of type: {start_vertices_dtype}."
)
warnings.warn(warning_msg, UserWarning)
start_vertices = start_vertices.astype(vertex_dtype)
Expand Down
1 change: 1 addition & 0 deletions python/cugraph/cugraph/tests/sampling/test_node2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def test_node2vec(graph_file, directed, compress, start_vertices_type):
)
num_verts = G.number_of_vertices()
k = random.randint(6, 12)
# FIXME: Random sample can make it hard to debug
start_vertices = cudf.Series(
random.sample(range(num_verts), k), dtype=start_vertices_type
)
Expand Down

0 comments on commit 6a44ca6

Please sign in to comment.