-
Notifications
You must be signed in to change notification settings - Fork 218
Description
Describe the bug
User reports ArrowInvalid error in g.plot() after retrieving data from memgraph using graphistry.cypher() - running from databricks notebook
g.plot() results in:
ArrowInvalid 'Could not convert "SomeString" with type str: tried to convert int64. Conversion failed for column id with type Object.
To Reproduce
- set up memgraph
curl https://install.memgraph.com | sh
-
log into memgraph ui at
http://memgraph-server:3000/ -
Manually add nodes for testing with the following cypher queries (unable to reproduce the error with this data, but important that the id fields are strings)
// Create nodes
MERGE (node1:Node {id: "1-abc"})
MERGE (node2:Node {id: "2-def"})
MERGE (node3:Node {id: "3-abc"})
MERGE (node4:Node {id: "4-def"})
// Create edges
MERGE (node1)-[:RELATIONSHIP {id: "e1-123"}]->(node2)
MERGE (node3)-[:RELATIONSHIP {id: "e2-123"}]->(node4)
MERGE (node1)-[:RELATIONSHIP {id: "e123"}]->(node4)
- load the following code into a databricks notebook:
#!pip install neo4j
#!pip install graphistry
## make sure to restart kernel after pip install
import awswrangler as wr
import pandas as pd
import graphistry
import neo4j
print(graphistry.__version__)
print(neo4j.__version__)
#graphistry.register(api=3, username="...", password="...", protocol="...", server="...")
# update with your cypher endpoint name:
url='memgraph_server_name'
## Connect to Memgraph using pygraphistry bolt connector
from neo4j import GraphDatabase
uri = f"bolt://{url}:7687"
#driver = GraphDatabase.driver(uri, auth=("ignored", "ignored"), encrypted=True)
driver = GraphDatabase.driver(uri, auth=("ignored", "ignored"), encrypted=False)
graphistry.register(bolt=driver)
g = graphistry.cypher("MATCH (a:Node)-[e]->(b) return a,e,b ")
g.plot() # results in error
# troubleshooting:
g._edges.head(3)
g._nodes.head(3)
g._nodes.dtypes
g._edges.dtypes
g._node, g._source, g._destinationExpected behavior
g.plot() should not error and should handle the conversion of the id field to int64
Actual behavior
see error above
Screenshots
Browser environment (please complete the following information):
waiting for the details
Graphistry GPU server environment
waiting for the details
PyGraphistry API client environment
waiting for the details
Additional context
Running from databricks, connecting to Memgraph