You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
property_graph.select_vertices() does not work with expressions with "in". Example:expression = "(v_prop in [1, 4, 5])"
Not sure if this's an actual bug or "in" is not supported in that function. The underlying issue is with using default python evalinselected_col = eval(expr, globals, locals)` which does not work well with dataframes. You may need to use https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.eval.html
Thank you @zmahoor for this issue and especially the minimal reproducer.
Since, as you noted, the implementation uses DataFrames and v_prop in your expression is a Series, the workaround is to use isin:
This is obviously not as nice or intuitive as your example since it requires the user to understand key implementation details, but hopefully it should unblock you.
Also, there's unfortunately some differences in support for DataFrame.eval between pandas and cudf which might cause other issues. For example, here's what we'd like to do (your example), which works well when Pandas DFs are used:
I think we should still strive to support a more natural expression like (v_prop in [1, 4, 5]) though. I wish I had a better answer but since this is likely non-trivial, we'll have to understand how best to support that and prioritize it accordingly.
Version
24.10
Which installation method(s) does this occur on?
Conda
Describe the bug.
property_graph.select_vertices()
does not work with expressions with "in". Example:expression = "(v_prop in [1, 4, 5])"
Not sure if this's an actual bug or "in" is not supported in that function. The underlying issue is with using default python eval
in
selected_col = eval(expr, globals, locals)` which does not work well with dataframes. You may need to use https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.eval.htmlMinimum reproducible example
Relevant log output
Environment details
Other/Misc.
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: