Skip to content

Commit

Permalink
Fixing broken path utility (#1576)
Browse files Browse the repository at this point in the history
Fix:

- Broken path utility

Authors:
  - Brad Rees (https://github.com/BradReesWork)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)

URL: #1576
  • Loading branch information
BradReesWork authored May 13, 2021
1 parent 4905a35 commit 6a94802
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/cugraph/utilities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def get_traversed_path(df, id):
----------
df : cudf.DataFrame
The dataframe containing the results of a BFS or SSSP call
id : Int
The vertex ID
id : vertex ID
most be the same data types as what is in the dataframe
Returns
---------
Expand Down Expand Up @@ -97,8 +97,9 @@ def get_traversed_path(df, id):
"DataFrame does not appear to be a BFS or "
"SSP result - 'predecessor' column missing"
)
if type(id) != int:
raise ValueError("The vertex 'id' needs to be an integer")
if isinstance(id, type(df['vertex'].iloc[0])):
raise ValueError(
"The vertex 'id' needs to be the same as df['vertex']")

# There is no guarantee that the dataframe has not been filtered
# or edited. Therefore we cannot assume that using the vertex ID
Expand Down Expand Up @@ -161,8 +162,9 @@ def get_traversed_path_list(df, id):
"DataFrame does not appear to be a BFS or "
"SSP result - 'predecessor' column missing"
)
if type(id) != int:
raise ValueError("The vertex 'id' needs to be an integer")
if isinstance(id, type(df['vertex'].iloc[0])):
raise ValueError(
"The vertex 'id' needs to be the same as df['vertex']")

# There is no guarantee that the dataframe has not been filtered
# or edited. Therefore we cannot assume that using the vertex ID
Expand Down

0 comments on commit 6a94802

Please sign in to comment.