neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 30 forks source link

unnest_relationships & unnest_nodes should fail gracefully when there is no node / rel #58

Open ColinFay opened 5 years ago

ColinFay commented 5 years ago

Current behavior:

> a <- call_neo4j("MATCH (tom {name: "Tom Hanks"}) RETURN tom", con, "graph")
> unnest_nodes(a$nodes)
# A tibble: 4 x 4
  id    value   born name     
  <chr> <chr>  <int> <chr>    
1 4441  Person  1956 Tom Hanks
2 7692  Person  1956 Tom Hanks
3 7863  Person  1956 Tom Hanks
4 8111  Person  1956 Tom Hanks

> unnest_relationships(a$relationships)
 Error in UseMethod("unnest_") : 
  no applicable method for 'unnest_' applied to an object of class "list" 

Which is super not helpful

Should fail gracefully instead.