From 02fe382d6bfc5e8ccab6e2024a5241379a02b7e0 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sat, 17 Sep 2022 13:12:35 +0200 Subject: Improve array_agg and Array processing The :class:`_functions.array_agg` will now set the array dimensions to 1. Improved :class:`_types.ARRAY` processing to accept ``None`` values as value of a multi-array. Fixes: #7083 Change-Id: Iafec4f77fde9719ccc7c8535bf6235dbfbc62102 --- test/sql/test_functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/sql') diff --git a/test/sql/test_functions.py b/test/sql/test_functions.py index 6c00660ff..a48d42f50 100644 --- a/test/sql/test_functions.py +++ b/test/sql/test_functions.py @@ -948,11 +948,14 @@ class ReturnTypeTest(AssertsCompiledSQL, fixtures.TestBase): expr = func.array_agg(column("data", Integer)) is_(expr.type._type_affinity, ARRAY) is_(expr.type.item_type._type_affinity, Integer) + is_(expr.type.dimensions, 1) def test_array_agg_array_datatype(self): - expr = func.array_agg(column("data", ARRAY(Integer))) + col = column("data", ARRAY(Integer)) + expr = func.array_agg(col) is_(expr.type._type_affinity, ARRAY) is_(expr.type.item_type._type_affinity, Integer) + eq_(expr.type.dimensions, col.type.dimensions) def test_array_agg_array_literal_implicit_type(self): from sqlalchemy.dialects.postgresql import array, ARRAY as PG_ARRAY -- cgit v1.2.1