Skip to content

Commit 160a7f6

Browse files
authored
fix TypeError (#2050)
1 parent b442110 commit 160a7f6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

redis/commands/graph/commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def execution_plan(self, query, params=None):
194194
query = self._build_params_header(params) + query
195195

196196
plan = self.execute_command("GRAPH.EXPLAIN", self.name, query)
197+
if isinstance(plan[0], bytes):
198+
plan = [b.decode() for b in plan]
197199
return "\n".join(plan)
198200

199201
def explain(self, query, params=None):

redis/commands/graph/execution_plan.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def __init__(self, plan):
6767
if not isinstance(plan, list):
6868
raise Exception("plan must be an array")
6969

70+
if isinstance(plan[0], bytes):
71+
plan = [b.decode() for b in plan]
72+
7073
self.plan = plan
7174
self.structured_plan = self._operation_tree()
7275

0 commit comments

Comments
 (0)