Skip to content

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

Open
wants to merge 51 commits into
base: master
Choose a base branch
from

Conversation

shivamka1
Copy link
Collaborator

No description provided.

@ljeub-pometry ljeub-pometry marked this pull request as ready for review April 3, 2025 15:21
Copy link
Collaborator

@miratepuffin miratepuffin left a 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):
Copy link
Collaborator

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)
Copy link
Collaborator

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"
Copy link
Collaborator

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])
Copy link
Collaborator

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"
Copy link
Collaborator

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"
Copy link
Collaborator

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)]
Copy link
Collaborator

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

Copy link
Collaborator

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.")]
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants