Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrowInvalid error in g.plot() after retrieving data from memgraph using graphistry.cypher() #611

Open
DataBoyTX opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels

Comments

@DataBoyTX
Copy link
Contributor

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

  1. set up memgraph
curl https://install.memgraph.com | sh
  1. log into memgraph ui at http://memgraph-server:3000/

  2. 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)
  1. 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._destination

Expected 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants