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

[BUG] to_cypher_value badly converts numpy objects #195

Closed
BorisTasevski opened this issue Oct 19, 2022 · 2 comments
Closed

[BUG] to_cypher_value badly converts numpy objects #195

BorisTasevski opened this issue Oct 19, 2022 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@BorisTasevski
Copy link
Contributor

BorisTasevski commented Oct 19, 2022

GQLAlchemy version 1.3.2

Describe the bug When converting NetworkX graph to cypher queries, if the graph is populated with numpy objects the utility method to_cypher_value makes wrong conversions for numpy objects(arrays)

Expected behavior numpy array gets converted as array

Steps to reproduce

graph = nx.Graph()
graph.add_nodes_from([
    (1, {"Key": np.array(["Value1", "Value2"], dtype=object)}),
]
)

cypher = nx_to_cypher(graph)

print (list(cypher)[0])

Expected result
CREATE ( {Key: ['Value1', 'Value2'], id: 1});

Actual result
CREATE ( {Key: '['Value1' 'Value2']', id: 1});

@katarinasupe
Copy link
Contributor

@BorisTasevski Please add steps to reproduce.

@BorisTasevski
Copy link
Contributor Author

Solved with

#208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants