Closed
Description
The read only command GRAPH.RO_QUERY is not supported in older versions of redisgraph. Using redisgraph 2.0.0
from redisgraph import Graph
import redis
if __name__ == '__main__':
r = redis.Redis()
graph = Graph('social', r)
result = graph.query('MATCH (n)-[t]->(m) RETURN (n), t, m')
print(result.result_set)
logs:
-> graph = Graph('social', r)
(Pdb) c
Traceback (most recent call last):
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 63, in get_label
label = self._labels[idx]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gnanesh/work/redisgraph-py/te.py", line 11, in <module>
result = graph.query('MATCH (n) RETURN (n)')
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 180, in query
raise e
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 176, in query
return QueryResult(self, response)
File "/home/gnanesh/work/redisgraph-py/redisgraph/query_result.py", line 62, in __init__
self.parse_results(response)
File "/home/gnanesh/work/redisgraph-py/redisgraph/query_result.py", line 84, in parse_results
self.result_set = self.parse_records(raw_result_set)
File "/home/gnanesh/work/redisgraph-py/redisgraph/query_result.py", line 113, in parse_records
record.append(self.parse_node(cell))
File "/home/gnanesh/work/redisgraph-py/redisgraph/query_result.py", line 148, in parse_node
label = self.graph.get_label(cell[1][0])
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 66, in get_label
self._refresh_labels()
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 38, in _refresh_labels
lbls = self.labels()
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 232, in labels
return self.call_procedure("db.labels", read_only=True).result_set
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 229, in call_procedure
return self.query(q, read_only=read_only)
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 180, in query
raise e
File "/home/gnanesh/work/redisgraph-py/redisgraph/graph.py", line 175, in query
response = self.redis_con.execute_command(*command)
File "/home/gnanesh/.local/lib/python3.10/site-packages/redis/client.py", line 901, in execute_command
return self.parse_response(conn, command_name, **options)
File "/home/gnanesh/.local/lib/python3.10/site-packages/redis/client.py", line 915, in parse_response
response = connection.read_response()
File "/home/gnanesh/.local/lib/python3.10/site-packages/redis/connection.py", line 756, in read_response
raise response
redis.exceptions.ResponseError: unknown command `GRAPH.RO_QUERY`, with args beginning with: `social`, `CALL db.labels()`, `--compact`,
Metadata
Metadata
Assignees
Labels
No labels