gqlalchemy
gqlalchemy copied to clipboard
[BUG] to_cypher_value badly converts numpy objects
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});
@BorisTasevski Please add steps to reproduce.
Solved with
https://github.com/memgraph/gqlalchemy/pull/208