diff --git a/redisgraph/query_result.py b/redisgraph/query_result.py index b37e21e..b0c6bda 100644 --- a/redisgraph/query_result.py +++ b/redisgraph/query_result.py @@ -129,7 +129,12 @@ def parse_scalar(self, cell): scalar = None elif scalar_type == ResultSetScalarTypes.VALUE_STRING: - scalar = str(value) + if isinstance(value, bytes): + scalar = value.decode() + elif not isinstance(value, str): + scalar = str(value) + else: + scalar = value elif scalar_type == ResultSetScalarTypes.VALUE_INTEGER: scalar = int(value) diff --git a/redisgraph/util.py b/redisgraph/util.py index d570d59..c7250f0 100644 --- a/redisgraph/util.py +++ b/redisgraph/util.py @@ -13,7 +13,10 @@ def quote_string(v): quote_string wraps given v with quotes incase v is a string. """ - if not isinstance(v, str): + + if isinstance(v, bytes): + v = v.decode() + elif not isinstance(v, str): return v if v[0] != '"':