You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: I'm using redisgraph:2.8.7 with redis-py. I met a error when I run explain. Error:
graph.explain('match (n:person) where n.name = "ken" return n')
raise exception
File "/lib/python3.8/site-packages/redis/commands/graph/commands.py", line 140, in explain
return "\n".join(plan)
TypeError: sequence item 0: expected str instance, bytes found
graph.execute_command('GRAPH.EXPLAIN', graph.name, 'match (n:person) where n.name = "ken" return n')
return
[b'Results',
b' Project',
b' Filter',
b' Node By Label Scan | (n:person)']
The problem is the result that type is List[byte].
I guess the code should modify as this:
defexplain(self, query, params=None):
""" Get the execution plan for given query, Returns an array of operations. For more information see `GRAPH.EXPLAIN <https://oss.redis.com/redisgraph/master/commands/#graphexplain>`_. # noqa Args: ------- query: The query that will be executed. params: dict Query parameters. """ifparamsisnotNone:
query=self._build_params_header(params) +queryplan=self.execute_command("GRAPH.EXPLAIN", self.name, query)
return"\n".join([b.decode() forbinplan])
or
defexplain(self, query, params=None):
""" Get the execution plan for given query, Returns an array of operations. For more information see `GRAPH.EXPLAIN <https://oss.redis.com/redisgraph/master/commands/#graphexplain>`_. # noqa Args: ------- query: The query that will be executed. params: dict Query parameters. """ifparamsisnotNone:
query=self._build_params_header(params) +queryplan=self.execute_command("GRAPH.EXPLAIN", self.name, query)
returnplan
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Version: 4.1.0
Python Version: 3.8
Platform: MacOS 12.0.1
Description: I'm using redisgraph:2.8.7 with redis-py. I met a error when I run explain. Error:
raise exception
return
The problem is the result that type is List[byte].
I guess the code should modify as this:
or
The text was updated successfully, but these errors were encountered: