From 780213bfefac7046ac889ffbc1c51e0d244dd678 Mon Sep 17 00:00:00 2001 From: Gord Thompson Date: Thu, 4 Mar 2021 06:55:53 -0700 Subject: Fix aggregate_order_by issue Fixes: #5989 Using array_agg() with aggregate_order_by() in postgresql would sometimes return ARRAY(NullType) instead of ARRAY(actual_type). Change-Id: I05a0b2b7ea59291e3c04575578adcc337296e5a8 --- lib/sqlalchemy/dialects/postgresql/ext.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/sqlalchemy/dialects/postgresql/ext.py') diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py index 71a0aa5a6..959e6597b 100644 --- a/lib/sqlalchemy/dialects/postgresql/ext.py +++ b/lib/sqlalchemy/dialects/postgresql/ext.py @@ -57,6 +57,7 @@ class aggregate_order_by(expression.ColumnElement): def __init__(self, target, *order_by): self.target = coercions.expect(roles.ExpressionElementRole, target) + self.type = self.target.type _lob = len(order_by) if _lob == 0: -- cgit v1.2.1