Skip to content

Unknown command GRAPH.RO_QUERY #123

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

Closed
GnaneshKunal opened this issue May 6, 2021 · 2 comments · Fixed by #124
Closed

Unknown command GRAPH.RO_QUERY #123

GnaneshKunal opened this issue May 6, 2021 · 2 comments · Fixed by #124

Comments

@GnaneshKunal
Copy link
Contributor

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`, 
@gkorland
Copy link
Contributor

gkorland commented May 6, 2021

@GnaneshKunal you're right it's not supported in RedisGraph 2.0. What is the question?

@GnaneshKunal
Copy link
Contributor Author

GnaneshKunal commented May 6, 2021

@GnaneshKunal you're right it's not supported in RedisGraph 2.0. What is the question?

The library is not usable for versions of redisgraph that doesn't have GRAPH.RO_QUERY command.

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

Successfully merging a pull request may close this issue.

2 participants