Skip to content

Fall back to GRAPH.QUERY when GRAPH.RO_QUERY is not available. #124

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions redisgraph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def query(self, q, params=None, timeout=None, read_only=False):
except redis.exceptions.ResponseError as e:
if "wrong number of arguments" in str(e):
print("Note: RedisGraph Python requires server version 2.2.8 or above")
if "unknown command" in str(e) and read_only:
# `GRAPH.RO_QUERY` is unavailable in older versions.
return self.query(q, params, timeout, read_only=False)
raise e
except VersionMismatchException as e:
# client view over the graph schema is out of sync
Expand Down