From a53008929f873b76c991b1c26294e2a6bf72f191 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Mon, 14 Mar 2022 13:35:31 +0200 Subject: [PATCH] fix TypeError --- redis/commands/graph/commands.py | 2 ++ redis/commands/graph/execution_plan.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/redis/commands/graph/commands.py b/redis/commands/graph/commands.py index baed1fc2f7..2be46cd902 100644 --- a/redis/commands/graph/commands.py +++ b/redis/commands/graph/commands.py @@ -194,6 +194,8 @@ def execution_plan(self, query, params=None): query = self._build_params_header(params) + query plan = self.execute_command("GRAPH.EXPLAIN", self.name, query) + if isinstance(plan[0], bytes): + plan = [b.decode() for b in plan] return "\n".join(plan) def explain(self, query, params=None): diff --git a/redis/commands/graph/execution_plan.py b/redis/commands/graph/execution_plan.py index a9b4ad076a..179a80cca0 100644 --- a/redis/commands/graph/execution_plan.py +++ b/redis/commands/graph/execution_plan.py @@ -67,6 +67,9 @@ def __init__(self, plan): if not isinstance(plan, list): raise Exception("plan must be an array") + if isinstance(plan[0], bytes): + plan = [b.decode() for b in plan] + self.plan = plan self.structured_plan = self._operation_tree()