-
Notifications
You must be signed in to change notification settings - Fork 60
Replace existing filters/filtering Raphtory APIs with composite filters and APIs/ Write tests #1982 #1991
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # raphtory/src/db/graph/views/filter/mod.rs # raphtory/src/python/types/wrappers/filter_expr.rs # raphtory/src/search/searcher.rs
…lated correctly to rust counterpart, fix/ref tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Half way through review
from raphtory import filter | ||
|
||
|
||
def init_graph(graph): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put all init graphs in the same place?
|
||
filter_expr1 = filter.Property("p2") == 4 | ||
filter_expr2 = filter.Property("p1") == "shivam_kapoor" | ||
result_ids = sorted(graph.filter_edges(filter_expr1 & filter_expr2).edges.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we test negation here?
assert result_ids == expected_ids | ||
|
||
|
||
filter_expr1 = filter.Edge.dst() == "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change a couple of these operators to be < > etc
graph = Graph() | ||
graph = init_graph(graph) | ||
|
||
filter_expr = filter.Property("p2").is_in([6]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test an empty list + a list with no values that exist in the graph
expected_ids = sorted(["1"]) | ||
assert result_ids == expected_ids | ||
|
||
filter_expr1 = filter.Node.name() == "2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change a couple of these expressions so they aren't all equals
graph = Graph() | ||
graph = init_graph(graph) | ||
|
||
filter_expr = filter.Edge.src() != "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change this to src.name just so that we dont break the APIs in the expanded feature set
(2, 3), | ||
(3, 4), | ||
] | ||
assert graph.filter_exploded_edges(Prop("test_int") > 2).edges.id == [(3, 4)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we disable this API for the second until we can use the new filter APIs -- can ignore the tests here
@@ -1,831 +0,0 @@ | |||
import tempfile | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bring these tests back
#[error("Value cannot be empty.")] | ||
EmptyValue, | ||
|
||
#[error("Filter must contain at least one filter condition.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In graphql what error is returned if I give a node property filter and a node name filter outside of an and/or
Is there anywhere else that you are returning this where the string doesn't make sense
No description provided.