summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-09-17 13:12:35 +0200
committerFederico Caselli <cfederico87@gmail.com>2022-09-17 13:12:35 +0200
commit02fe382d6bfc5e8ccab6e2024a5241379a02b7e0 (patch)
tree71be66e11aec5224f77f8e4e4e62ad9bd3fb6491 /test/sql
parentf582618afe1a5b112a1a22ddd0cbfcc8b97c8f09 (diff)
downloadsqlalchemy-02fe382d6bfc5e8ccab6e2024a5241379a02b7e0.tar.gz
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
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_functions.py5
1 files changed, 4 insertions, 1 deletions
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