Skip to content

Commit 6663475

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

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

redisgraph/graph.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,8 @@ def query(self, q, params=None, timeout=None, read_only=False):
179179
print("Note: RedisGraph Python requires server version 2.2.8 or above")
180180
if "unknown command" in str(e):
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+
if read_only:
183+
return self.query(q, params, timeout, read_only=False)
185184
raise e
186185
except VersionMismatchException as e:
187186
# client view over the graph schema is out of sync

0 commit comments

Comments
 (0)