However, when I tried this query at redisgraph-py, I got an error.
Here is my code,
import redis
from redisgraph import Node, Edge, Graph
r = redis.Redis(host='localhost', port=6379)
redis_graph = Graph('Toy', r)
query = 'Match (p) RETURN p'
result = redis_graph.query(query)
print(result)
The error stack is
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2066, in <module>
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2060, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1411, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1418, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/augustinpan/Documents/Columbia/FlyBrainLab/grapharcana/grapharcana/dialects/test.py", line 10, in <module>
result = redis_graph.query(query)
File "/Users/augustinpan/Documents/Columbia/FlyBrainLab/grapharcana/venv/lib/python3.6/site-packages/redisgraph/client.py", line 160, in query
return QueryResult(result_set, statistics)
File "/Users/augustinpan/Documents/Columbia/FlyBrainLab/grapharcana/venv/lib/python3.6/site-packages/redisgraph/query_result.py", line 17, in __init__
self.parsed_statistics = self._retrieve_data_from_statistics(statistics)
File "/Users/augustinpan/Documents/Columbia/FlyBrainLab/grapharcana/venv/lib/python3.6/site-packages/redisgraph/query_result.py", line 45, in _retrieve_data_from_statistics
self.LABELS_ADDED: self._get_value(self.LABELS_ADDED, statistics),
File "/Users/augustinpan/Documents/Columbia/FlyBrainLab/grapharcana/venv/lib/python3.6/site-packages/redisgraph/query_result.py", line 57, in _get_value
stat = stat.decode()
AttributeError: 'list' object has no attribute 'decode'
My debugger shows the response from self.redis_con.execute_command("GRAPH.QUERY", self.name, q) like
I am new to RedisGraph. My python version is 3.6.
I have a simple graph: (:Person {name: John}) --[:Work]-->(:Job {type: Software Engineer}).
I tried query at
redis-cli
, and it works fine and returnHowever, when I tried this query at
redisgraph-py
, I got an error.Here is my code,
The error stack is
My debugger shows the
response
fromself.redis_con.execute_command("GRAPH.QUERY", self.name, q)
like