python3: decode psycopg mogrified values (#40570)
This commit is contained in:
parent
f987c27631
commit
34685564ad
|
@ -116,7 +116,7 @@ psycopg2.extensions.register_type(POINT_ARRAY)
|
||||||
|
|
||||||
|
|
||||||
def to_tuple(cur, values):
|
def to_tuple(cur, values):
|
||||||
return cur.mogrify(', '.join(['%s'] * len(values)), values)
|
return force_text(cur.mogrify(', '.join(['%s'] * len(values)), values))
|
||||||
|
|
||||||
|
|
||||||
Member = collections.namedtuple('Member', ['id', 'label'])
|
Member = collections.namedtuple('Member', ['id', 'label'])
|
||||||
|
@ -166,7 +166,7 @@ class EngineDimension(object):
|
||||||
if not condition:
|
if not condition:
|
||||||
continue
|
continue
|
||||||
with self.engine.get_cursor() as cursor: # Ugly...
|
with self.engine.get_cursor() as cursor: # Ugly...
|
||||||
condition = cursor.mogrify(condition, values)
|
condition = force_text(cursor.mogrify(condition, values))
|
||||||
if dimension.filter_needs_join and dimension.join:
|
if dimension.filter_needs_join and dimension.join:
|
||||||
joins.update(dimension.join)
|
joins.update(dimension.join)
|
||||||
conditions.append(condition)
|
conditions.append(condition)
|
||||||
|
@ -383,7 +383,7 @@ class EngineCube(object):
|
||||||
condition, values = dimension.build_filter(values)
|
condition, values = dimension.build_filter(values)
|
||||||
if not condition:
|
if not condition:
|
||||||
continue
|
continue
|
||||||
condition = cursor.mogrify(condition, values)
|
condition = force_text(cursor.mogrify(condition, values))
|
||||||
if dimension.filter_needs_join and dimension.join:
|
if dimension.filter_needs_join and dimension.join:
|
||||||
joins.update(dimension.join)
|
joins.update(dimension.join)
|
||||||
if dimension.filter_in_join:
|
if dimension.filter_in_join:
|
||||||
|
|
Loading…
Reference in New Issue