Skip to content

Commit d4e9714

Browse files
authored
select between RO_QUERY and QUERY (#102)
1 parent 5c7ba4c commit d4e9714

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

redisgraph/graph.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def query(self, q, params=None, timeout=None, read_only=False):
156156
# construct query command
157157
# ask for compact result-set format
158158
# specify known graph version
159-
command = [("GRAPH.QUERY","GRAPH.RO_QUERY")[read_only], self.name, query, "--compact", "version", self.version]
159+
cmd = "GRAPH.RO_QUERY" if read_only else "GRAPH.QUERY"
160+
command = [cmd, self.name, query, "--compact", "version", self.version]
160161

161162
# include timeout is specified
162163
if timeout:

0 commit comments

Comments
 (0)