Skip to content

fixes filter_edges for layers is broken after add_constant_properties#2123

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

fixes filter_edges for layers is broken after add_constant_properties#2123
shivamka1 merged 4 commits intomasterfrom
fix/layers_filter_edges_const_props

Conversation

@shivamka1
Copy link
Collaborator

@shivamka1 shivamka1 commented Jun 13, 2025

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()

Copy link
Collaborator

@ljeub-pometry ljeub-pometry left a comment

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

CLAassistant commented Jun 16, 2025

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
5 of 6 checks passed
@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