Skip to content

Commit f57ceb4

Browse files
committed
Call the same method by setting read_only to False
1 parent 060bbdd commit f57ceb4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

redisgraph/graph.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,9 @@ def query(self, q, params=None, timeout=None, read_only=False):
177177
except redis.exceptions.ResponseError as e:
178178
if "wrong number of arguments" in str(e):
179179
print("Note: RedisGraph Python requires server version 2.2.8 or above")
180-
if "unknown command" in str(e):
180+
if "unknown command" in str(e) and read_only:
181181
# `GRAPH.RO_QUERY` is unavailable in older versions.
182-
command[0] = "GRAPH.QUERY"
183-
response = self.redis_con.execute_command(*command)
184-
return QueryResult(self, response)
182+
return self.query(q, params, timeout, read_only=False)
185183
raise e
186184
except VersionMismatchException as e:
187185
# client view over the graph schema is out of sync

0 commit comments

Comments
 (0)