From e2ed7c7e347bbf94ea3ff5be54e92dbcdba19645 Mon Sep 17 00:00:00 2001 From: swilly22 Date: Mon, 23 Nov 2020 21:51:01 +0200 Subject: [PATCH] select between RO_QUERY and QUERY --- redisgraph/graph.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redisgraph/graph.py b/redisgraph/graph.py index d1b9bb2..1ab6d37 100644 --- a/redisgraph/graph.py +++ b/redisgraph/graph.py @@ -156,7 +156,8 @@ def query(self, q, params=None, timeout=None, read_only=False): # construct query command # ask for compact result-set format # specify known graph version - command = [("GRAPH.QUERY","GRAPH.RO_QUERY")[read_only], self.name, query, "--compact", "version", self.version] + cmd = "GRAPH.RO_QUERY" if read_only else "GRAPH.QUERY" + command = [cmd, self.name, query, "--compact", "version", self.version] # include timeout is specified if timeout: