Properties types labels loading inspect#32
Conversation
2278639 to
fdb9d23
Compare
60568a1 to
41915e5
Compare
41915e5 to
6da7f29
Compare
| create_relationship_cypher_match_query(node_labels, []) | ||
| + " RETURN DISTINCT TYPE(r) as relationship_types" | ||
| ) | ||
| type_extractor = """ |
There was a problem hiding this comment.
Does the this type_extractor part need to be changed? I thought RETURN DISTINCT TYPE(r) as relationship_types worked.
| with driver.session() as session: | ||
| session.run("MATCH (n:Foo) DETACH DELETE n") | ||
| session.run("MATCH (n:Bar) DETACH DELETE n") | ||
|
|
||
| res = session.run( | ||
| "MATCH (n) WHERE 'Foo' IN labels(n) OR 'Bar' IN labels(n) RETURN count(n) as count" | ||
| ) | ||
| existing_count2 = res.single()["count"] | ||
|
|
||
| driver.close() | ||
| # assertions at the end to ensure failures do not affect other tests | ||
| assert existing_count2 == 0 |
There was a problem hiding this comment.
what is this section trying to test..?
There was a problem hiding this comment.
I just want to ensure all data is deleted, because if something is forgotten to be deleted it will mess up any remaining tests run after it. just a safety check really !
| gds = GraphDataScience(driver) | ||
| with driver.session() as session: | ||
| session.run( | ||
| "CREATE (:Foo{prop1:1})-[:R1{relprop1:2}]->(:Bar), (:Bar)-[:R2{relprop2:2}]->(:Bar{prop2:2})" |
There was a problem hiding this comment.
I think we want to extend this to cover the most general graph.
I believe the only missing case is multi-labelled nodes, and nodes/edges with multiple properties.
| assert "relprop1" in rel_props | ||
| assert "relprop2" in rel_props | ||
| assert "prop1" in node_props | ||
| assert "prop2" in node_props |
There was a problem hiding this comment.
Maybe we want to assert equality of set/multiset(whichever appropriate) for all of them.
| UNWIND prop_keys_list AS prop_keys | ||
| WITH DISTINCT prop_keys | ||
| RETURN COLLECT(prop_keys) AS properties_keys | ||
| """ |
There was a problem hiding this comment.
The test looks good so this should be correct. But I don't see why it had to be changed. Was the property_extractor wrong before?
| WITH keys(properties(r)) AS prop_keys_list | ||
| UNWIND prop_keys_list AS prop_keys | ||
| WITH DISTINCT prop_keys | ||
| RETURN COLLECT(prop_keys) AS properties_keys |
There was a problem hiding this comment.
The test looks good so this should be correct. But I don't see why it had to be changed. Was the property_extractor wrong before?
62056b3 to
1fd189f
Compare
1fd189f to
74d80c7
Compare
No description provided.