Skip to content

fixes filter_edges for layers is broken after add_constant_properties - #2123

Merged
shivamka1 merged 4 commits into
masterfrom
fix/layers_filter_edges_const_props
Jun 16, 2025
Merged

shivamka1 merged 4 commits into
masterfrom
fix/layers_filter_edges_const_props

Conversation

@shivamka1

@shivamka1 shivamka1 commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor

When we add constant props to edge layers, we compare map of constant props instead.

let edge = graph
    .add_edge(1, "shivam", "kapoor", [("p1", 100u64)], Some("fire_nation"))
    .unwrap();
edge.add_constant_properties([("z", true)], Some("fire_nation"))
    .unwrap();

let filter = PropertyFilter::property("z")
    .constant()
    .eq(Prop::map([("fire_nation", true)]));
assert_eq!(filter_edges(&graph, filter), vec!["shivam->kapoor"]);

We also have num_layers api allowing us to fetch the number of unique layers in graph

graph.num_layers()

Comment thread raphtory/src/db/api/view/layer.rs
Comment thread raphtory/src/db/graph/views/filter/model/property_filter.rs Outdated

@ljeub-pometry ljeub-pometry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map validation could be improved...

@CLAassistant

CLAassistant commented Jun 16, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@shivamka1
shivamka1 force-pushed the fix/layers_filter_edges_const_props branch from dc50a3b to 2b3a912 Compare June 16, 2025 15:42
@shivamka1
shivamka1 merged commit f7df883 into master Jun 16, 2025
@shivamka1
shivamka1 deleted the fix/layers_filter_edges_const_props branch June 16, 2025 15:57
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.

4 participants