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

Fixing broken path utility #1576

Merged
merged 2 commits into from
May 13, 2021
Merged
Changes from all commits
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
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