Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def query(self, q):
"""
Executes a query against the graph.
"""
statistics = None
result_set = None
response = self.redis_con.execute_command("GRAPH.QUERY", self.name, q)
result_set = response[0]
statistics = response[1]
return QueryResult(result_set, statistics)
def query(self, q, params=None):
"""
Executes a query against the graph.
"""
if params is not None:
q = self.build_params_header(params) + q
statistics = None
result_set = None
response = self.redis_con.execute_command("GRAPH.QUERY", self.name, q, "--compact")
return QueryResult(self, response)