Repository: edgedb/edgedb

Issue:
Don't have `{}` act as a wildcard in `assert_query_result`
For assert_query_result, the empty dict `{}` currently acts as a "wild card", that will match anything.

This is because it checks each element in the dict, and so if the dict is empty, it doesn't look at the returned data at all.

I think we should make sure that `{}` only matches dictionaries, and should add in a separate wildcard facility.
We should maybe also have it check that the result dictionary doesn't contain any *extra* keys, except for `id` and `__tname__`. (We don't really have a good way to distinguish between named tuples and objects in this interface, so I don't think we can do the *best* thing and *insist* that those are inserted when appropriate).


Discussion:

Resolving patch:
diff --git a/edb/testbase/server.py b/edb/testbase/server.py
--- a/edb/testbase/server.py
+++ b/edb/testbase/server.py
@@ -833,6 +833,13 @@ def _assert_type_shape(path, data, shape):
                         f'{_format_path(path)}')
 
         def _assert_dict_shape(path, data, shape):
+            if not isinstance(data, dict):
+                self.fail(
+                    f'{message}: expected dict '
+                    f'{_format_path(path)}')
+
+            # TODO: should we also check that there aren't *extra* keys
+            # (other than id, __tname__?)
             for sk, sv in shape.items():
                 if not data or sk not in data:
                     self.fail(


Test patch:
diff --git a/tests/test_edgeql_calls.py b/tests/test_edgeql_calls.py
--- a/tests/test_edgeql_calls.py
+++ b/tests/test_edgeql_calls.py
@@ -561,22 +561,22 @@ async def test_edgeql_calls_13(self):
 
         await self.assert_query_result(
             r'''SELECT call13('aaa');''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT call13(b'aaaa');''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT call13([1, 2, 3, 4, 5]);''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT call13(['a', 'b']);''',
-            [{}],
+            [1],
         )
 
         await self.con.execute('''
@@ -773,7 +773,7 @@ async def test_edgeql_calls_18(self):
 
         await self.assert_query_result(
             r'''SELECT call18(2);''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -987,7 +987,7 @@ async def test_edgeql_calls_26(self):
 
         await self.assert_query_result(
             r'''SELECT call26(['aaa']);''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -1131,7 +1131,7 @@ async def test_edgeql_calls_31(self):
 
         await self.assert_query_result(
             r'''SELECT call31([1, 2])[0];''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -1161,17 +1161,17 @@ async def test_edgeql_calls_31(self):
 
         await self.assert_query_result(
             r'''SELECT call31((a:=[(x:=1)])).a[0].x;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT call31((a:=[(x:=1)])).0[0].x;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT call31((a:=[(x:=1)])).0[0].0;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
diff --git a/tests/test_edgeql_casts.py b/tests/test_edgeql_casts.py
--- a/tests/test_edgeql_casts.py
+++ b/tests/test_edgeql_casts.py
@@ -1319,37 +1319,37 @@ async def test_edgeql_casts_numeric_05(self):
     async def test_edgeql_casts_numeric_06(self):
         await self.assert_query_result(
             r'''SELECT <int16>1;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT <int32>1;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT <int64>1;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT <float32>1;''',
-            [{}],
+            [1.0],
         )
 
         await self.assert_query_result(
             r'''SELECT <float64>1;''',
-            [{}],
+            [1.0],
         )
 
         await self.assert_query_result(
             r'''SELECT <bigint>1;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
             r'''SELECT <decimal>1;''',
-            [{}],
+            [1],
         )
 
     async def test_edgeql_casts_numeric_07(self):
@@ -1361,7 +1361,7 @@ async def test_edgeql_casts_numeric_07(self):
                 f'''
                     SELECT <{t1}><{t2}>1;
                 ''',
-                [{}],
+                [1],
             )
 
     async def test_edgeql_casts_collections_01(self):
diff --git a/tests/test_edgeql_ddl.py b/tests/test_edgeql_ddl.py
--- a/tests/test_edgeql_ddl.py
+++ b/tests/test_edgeql_ddl.py
@@ -591,7 +591,7 @@ async def test_edgeql_ddl_15(self):
                 } ORDER BY TestSelfLink2.foo2;
             """,
             [
-                {'bar2': {}, 'foo2': 'Alice'},
+                {'bar2': [], 'foo2': 'Alice'},
                 {'bar2': {'Alice'}, 'foo2': 'Bob'},
                 {'bar2': {'Alice', 'Bob'}, 'foo2': 'Carol'}
             ],
@@ -3519,7 +3519,7 @@ async def test_edgeql_ddl_function_06(self):
             r"""
                 SELECT int_func_1();
             """,
-            [{}],
+            [1],
         )
 
     async def test_edgeql_ddl_function_07(self):
@@ -6445,9 +6445,14 @@ async def test_edgeql_ddl_extending_04(self):
                     (SELECT ggc.properties FILTER .name = 'a')
                         .annotations@value;
             """,
-            {}
+            []
         )
 
+    @test.xfail('''
+        Default value ought to get reset back to non-existent, since it
+        was inherited? (Or actually maybe not, since the prop is owned
+        by then?)
+    ''')
     async def test_edgeql_ddl_extending_05(self):
         # Check that field alters are propagated.
         await self.con.execute(r"""
@@ -6518,7 +6523,7 @@ async def test_edgeql_ddl_extending_05(self):
 
         await self.con.execute(r"""
             ALTER TYPE ExtC5 ALTER PROPERTY a SET REQUIRED;
-            ALTER TYPE ExtC5 DROP EXTENDING ExtA5;
+            ALTER TYPE ExtC5 DROP EXTENDING ExtB5;
         """)
 
         await self.assert_query_result(
@@ -6532,7 +6537,7 @@ async def test_edgeql_ddl_extending_05(self):
                     (SELECT C5.properties FILTER .name = 'a')
                         .default;
             """,
-            {}
+            []
         )
 
     async def test_edgeql_ddl_modules_01(self):
@@ -8188,7 +8193,7 @@ async def test_edgeql_ddl_constraint_alter_01(self):
                 'name': 'default::ConTest01',
                 'properties': [{
                     'name': 'con_test',
-                    'constraints': {},
+                    'constraints': [],
                 }]
             }
         ])
diff --git a/tests/test_edgeql_expressions.py b/tests/test_edgeql_expressions.py
--- a/tests/test_edgeql_expressions.py
+++ b/tests/test_edgeql_expressions.py
@@ -3684,7 +3684,7 @@ async def test_edgeql_expr_tuple_indirection_05(self):
     async def test_edgeql_expr_tuple_indirection_06(self):
         await self.assert_query_result(
             r'''SELECT (1, ('a', 'b', (0.1, 0.2)), 2, 3).0;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -3705,7 +3705,7 @@ async def test_edgeql_expr_tuple_indirection_06(self):
     async def test_edgeql_expr_tuple_indirection_07(self):
         await self.assert_query_result(
             r'''WITH A := (1, ('a', 'b', (0.1, 0.2)), 2, 3) SELECT A.0;''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -4480,7 +4480,7 @@ async def test_edgeql_expr_comparison_03(self):
     async def test_edgeql_expr_aggregate_01(self):
         await self.assert_query_result(
             r'''SELECT count(DISTINCT {1, 1, 1});''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -5258,7 +5258,7 @@ async def test_edgeql_introspect_without_shape(self):
                 SELECT (INTROSPECT TYPEOF BaseObject)
             """,
             [
-                {"id": {}}
+                {"id": str}
             ]
         )
         res = await self.con._fetchall("""
diff --git a/tests/test_edgeql_functions.py b/tests/test_edgeql_functions.py
--- a/tests/test_edgeql_functions.py
+++ b/tests/test_edgeql_functions.py
@@ -100,7 +100,7 @@ async def test_edgeql_functions_array_agg_01(self):
     async def test_edgeql_functions_array_agg_02(self):
         await self.assert_query_result(
             r'''SELECT array_agg({1, 2, 3})[0];''',
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -2836,7 +2836,7 @@ async def test_edgeql_functions_min_02(self):
             r'''
                 SELECT min(<int64>Issue.number);
             ''',
-            [{}],
+            [1],
         )
 
     async def test_edgeql_functions_min_03(self):
@@ -3435,17 +3435,17 @@ async def test_edgeql_functions_contains_02(self):
     async def test_edgeql_functions_contains_03(self):
         await self.assert_query_result(
             r'''SELECT contains(<str>{}, <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT contains(<str>{}, 'a');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT contains('qwerty', <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -3486,17 +3486,17 @@ async def test_edgeql_functions_contains_03(self):
     async def test_edgeql_functions_contains_04(self):
         await self.assert_query_result(
             r'''SELECT contains(<bytes>{}, <bytes>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT contains(<bytes>{}, b'a');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT contains(b'qwerty', <bytes>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -3517,17 +3517,17 @@ async def test_edgeql_functions_contains_04(self):
     async def test_edgeql_functions_find_01(self):
         await self.assert_query_result(
             r'''SELECT find(<str>{}, <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT find(<str>{}, 'a');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT find('qwerty', <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -3568,7 +3568,7 @@ async def test_edgeql_functions_find_01(self):
     async def test_edgeql_functions_find_02(self):
         await self.assert_query_result(
             r'''SELECT find(<bytes>{}, <bytes>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -3589,17 +3589,17 @@ async def test_edgeql_functions_find_02(self):
     async def test_edgeql_functions_find_03(self):
         await self.assert_query_result(
             r'''SELECT find(<array<str>>{}, <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT find(<array<str>>{}, 'the');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT find(['the', 'quick', 'brown', 'fox'], <str>{});''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
diff --git a/tests/test_edgeql_insert.py b/tests/test_edgeql_insert.py
--- a/tests/test_edgeql_insert.py
+++ b/tests/test_edgeql_insert.py
@@ -870,7 +870,7 @@ async def test_edgeql_insert_returning_10(self):
             ''',
             [{
                 'name': 'test',
-                'subject': {'id': {}},
+                'subject': {'id': str},
             }],
         )
 
@@ -1893,7 +1893,7 @@ async def test_edgeql_insert_empty_04(self):
             """,
             [{
                 'l2': 99,
-                'subordinates': {},
+                'subordinates': [],
             }],
         )
 
@@ -3900,7 +3900,7 @@ async def test_edgeql_insert_dependent_27(self):
                 }
                 UNLESS CONFLICT ON .name ELSE (SELECT Obj);
             ''',
-            [{"id": {}}]
+            [{"id": str}]
         )
 
         await self.assert_query_result(
diff --git a/tests/test_edgeql_introspection.py b/tests/test_edgeql_introspection.py
--- a/tests/test_edgeql_introspection.py
+++ b/tests/test_edgeql_introspection.py
@@ -601,7 +601,7 @@ async def test_edgeql_introspection_constraint_05(self):
                             {
                                 'name': 'std::max_len_value',
                                 'expr': '(__subject__ <= max)',
-                                'annotations': {},
+                                'annotations': [],
                                 'subject': {'name': 'body'},
                                 'params': [
                                     {
@@ -624,9 +624,9 @@ async def test_edgeql_introspection_constraint_05(self):
                             {
                                 'name': 'std::exclusive',
                                 'expr': 'std::_is_exclusive(__subject__)',
-                                'annotations': {},
+                                'annotations': [],
                                 'subject': {'name': 'id'},
-                                'params': {},
+                                'params': [],
                                 'return_typemod': 'SingletonType',
                                 'return_type': {'name': 'std::bool'},
                                 'errmessage':
@@ -671,7 +671,7 @@ async def test_edgeql_introspection_constraint_06(self):
                     {
                         'name': 'std::one_of',
                         'expr': 'std::contains(vals, __subject__)',
-                        'annotations': {},
+                        'annotations': [],
                         'subject': {'name': 'default::EmulatedEnum'},
                         'params': [
                             {
diff --git a/tests/test_edgeql_json.py b/tests/test_edgeql_json.py
--- a/tests/test_edgeql_json.py
+++ b/tests/test_edgeql_json.py
@@ -824,7 +824,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '100');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -832,7 +832,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, 'foo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -840,7 +840,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '0', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -848,7 +848,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '1', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -856,7 +856,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '2', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -864,7 +864,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '3', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -883,7 +883,7 @@ async def test_edgeql_json_get_01(self):
             WITH JT3 := (SELECT JSONTest FILTER .number = 3)
             SELECT json_get(JT3.data, '4', 'b', 'foo', '2', 'bingo');
             ''',
-            {}
+            []
         )
 
     async def test_edgeql_json_get_02(self):
@@ -904,40 +904,40 @@ async def test_edgeql_json_get_02(self):
 
         await self.assert_query_result(
             r'''SELECT json_get(JSONTest.data, '100');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''SELECT json_get(JSONTest.data, 'foo');''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT json_get(JSONTest.data, '0', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT json_get(JSONTest.data, '1', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT json_get(JSONTest.data, '2', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT json_get(JSONTest.data, '3', 'b', 'bar', '2', 'bingo');
             ''',
-            {},
+            [],
         )
 
         await self.assert_query_result(
@@ -952,7 +952,7 @@ async def test_edgeql_json_get_02(self):
             r'''
                 SELECT json_get(JSONTest.data, '4', 'b', 'foo', '2', 'bingo');
             ''',
-            {}
+            []
         )
 
     async def test_edgeql_json_get_03(self):
diff --git a/tests/test_edgeql_linkatoms.py b/tests/test_edgeql_linkatoms.py
--- a/tests/test_edgeql_linkatoms.py
+++ b/tests/test_edgeql_linkatoms.py
@@ -50,12 +50,12 @@ async def test_edgeql_links_basic_02(self):
                 }, {
                     'name': 'chair',
                     'tag_set1': {'wood', 'rectangle'},
-                    'tag_set2': {},
+                    'tag_set2': [],
                     'tag_array': ['wood', 'rectangle'],
                 }, {
                     'name': 'ectoplasm',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                     'tag_array': None,
                 }, {
                     'name': 'floor lamp',
@@ -64,8 +64,8 @@ async def test_edgeql_links_basic_02(self):
                     'tag_array': ['metal', 'plastic'],
                 }, {
                     'name': 'mystery toy',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                     'tag_array': None,
                 }, {
                     'name': 'table',
@@ -74,12 +74,12 @@ async def test_edgeql_links_basic_02(self):
                     'tag_array': ['wood', 'rectangle'],
                 }, {
                     'name': 'teapot',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                     'tag_array': ['ceramic', 'round'],
                 }, {
                     'name': 'tv',
-                    'tag_set1': {},
+                    'tag_set1': [],
                     'tag_set2': {'plastic', 'rectangle'},
                     'tag_array': ['plastic', 'rectangle'],
                 },
@@ -103,30 +103,30 @@ async def test_edgeql_links_map_scalars_01(self):
                 }, {
                     'name': 'chair',
                     'tag_set1': ['wood', 'rectangle'],
-                    'tag_set2': {},
+                    'tag_set2': [],
                 }, {
                     'name': 'ectoplasm',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'floor lamp',
                     'tag_set1': ['plastic', 'metal'],
                     'tag_set2': ['metal', 'plastic'],
                 }, {
                     'name': 'mystery toy',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'table',
                     'tag_set1': ['wood', 'rectangle'],
                     'tag_set2': ['rectangle', 'wood'],
                 }, {
                     'name': 'teapot',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'tv',
-                    'tag_set1': {},
+                    'tag_set1': [],
                     'tag_set2': ['plastic', 'rectangle'],
                 },
             ]
@@ -149,30 +149,30 @@ async def test_edgeql_links_map_scalars_02(self):
                 }, {
                     'name': 'chair',
                     'tag_set1': ['wood'],
-                    'tag_set2': {},
+                    'tag_set2': [],
                 }, {
                     'name': 'ectoplasm',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'floor lamp',
                     'tag_set1': ['plastic'],
                     'tag_set2': ['plastic'],
                 }, {
                     'name': 'mystery toy',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'table',
                     'tag_set1': ['wood'],
                     'tag_set2': ['wood'],
                 }, {
                     'name': 'teapot',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'tv',
-                    'tag_set1': {},
+                    'tag_set1': [],
                     'tag_set2': ['rectangle'],
                 },
             ]
@@ -195,30 +195,30 @@ async def test_edgeql_links_map_scalars_03(self):
                 }, {
                     'name': 'chair',
                     'tag_set1': {'wood', 'rectangle'},
-                    'tag_set2': {},
+                    'tag_set2': [],
                 }, {
                     'name': 'ectoplasm',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'floor lamp',
                     'tag_set1': {'plastic'},
                     'tag_set2': {'metal', 'plastic'},
                 }, {
                     'name': 'mystery toy',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'table',
                     'tag_set1': {'wood', 'rectangle'},
                     'tag_set2': {'rectangle'},
                 }, {
                     'name': 'teapot',
-                    'tag_set1': {},
-                    'tag_set2': {},
+                    'tag_set1': [],
+                    'tag_set2': [],
                 }, {
                     'name': 'tv',
-                    'tag_set1': {},
+                    'tag_set1': [],
                     'tag_set2': {'plastic', 'rectangle'},
                 },
             ]
@@ -377,35 +377,35 @@ async def test_edgeql_links_set_06(self):
             [
                 {
                     'name': 'ball',
-                    'foo': {},
-                    'bar': {},
+                    'foo': [],
+                    'bar': [],
                 }, {
                     'name': 'chair',
                     'foo': {'wood', 'rectangle'},
-                    'bar': {},
+                    'bar': [],
                 }, {
                     'name': 'ectoplasm',
-                    'foo': {},
-                    'bar': {},
+                    'foo': [],
+                    'bar': [],
                 }, {
                     'name': 'floor lamp',
-                    'foo': {},
-                    'bar': {},
+                    'foo': [],
+                    'bar': [],
                 }, {
                     'name': 'mystery toy',
-                    'foo': {},
-                    'bar': {},
+                    'foo': [],
+                    'bar': [],
                 }, {
                     'name': 'table',
                     'foo': {'wood', 'rectangle'},
                     'bar': {'wood', 'rectangle'},
                 }, {
                     'name': 'teapot',
-                    'foo': {},
-                    'bar': {},
+                    'foo': [],
+                    'bar': [],
                 }, {
                     'name': 'tv',
-                    'foo': {},
+                    'foo': [],
                     'bar': {'rectangle'},
                 },
             ],
@@ -677,19 +677,19 @@ async def test_edgeql_links_array_01(self):
             [
                 {
                     'name': 'ball',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'chair',
                     'unpack': {'rectangle', 'wood'}
                 }, {
                     'name': 'ectoplasm',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'floor lamp',
                     'unpack': {'metal', 'plastic'}
                 }, {
                     'name': 'mystery toy',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'table',
                     'unpack': {'rectangle', 'wood'}
@@ -716,19 +716,19 @@ async def test_edgeql_links_array_02(self):
             [
                 {
                     'name': 'ball',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'chair',
                     'unpack': {'rectangle', 'wood'}
                 }, {
                     'name': 'ectoplasm',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'floor lamp',
                     'unpack': {'metal', 'plastic'}
                 }, {
                     'name': 'mystery toy',
-                    'unpack': {}
+                    'unpack': []
                 }, {
                     'name': 'table',
                     'unpack': {'rectangle', 'wood'}
@@ -847,28 +847,28 @@ async def test_edgeql_links_array_09(self):
             [
                 {
                     'name': 'ball',
-                    'unique': {}
+                    'unique': []
                 }, {
                     'name': 'chair',
-                    'unique': {}
+                    'unique': []
                 }, {
                     'name': 'ectoplasm',
-                    'unique': {}
+                    'unique': []
                 }, {
                     'name': 'floor lamp',
                     'unique': {'metal'}
                 }, {
                     'name': 'mystery toy',
-                    'unique': {}
+                    'unique': []
                 }, {
                     'name': 'table',
-                    'unique': {}
+                    'unique': []
                 }, {
                     'name': 'teapot',
                     'unique': {'ceramic', 'round'}
                 }, {
                     'name': 'tv',
-                    'unique': {}
+                    'unique': []
                 },
             ],
         )
diff --git a/tests/test_edgeql_scope.py b/tests/test_edgeql_scope.py
--- a/tests/test_edgeql_scope.py
+++ b/tests/test_edgeql_scope.py
@@ -2654,7 +2654,7 @@ async def test_edgeql_scope_computables_11c(self):
                 SELECT (U.cards.a.name, U.cards.a.id, U.cards) LIMIT 1;
             """,
             [
-                [{}, {}, {"id": {}}],
+                [str, str, {"id": str}],
             ],
         )
 
diff --git a/tests/test_edgeql_select.py b/tests/test_edgeql_select.py
--- a/tests/test_edgeql_select.py
+++ b/tests/test_edgeql_select.py
@@ -741,7 +741,7 @@ async def test_edgeql_select_computable_33(self):
             SELECT User {name, todo_ids := .todo.id} FILTER .name = 'Elvis';
             """,
             [
-                {'name': 'Elvis', 'todo_ids': [{}, {}]},
+                {'name': 'Elvis', 'todo_ids': [str, str]},
             ]
         )
 
@@ -752,7 +752,7 @@ async def test_edgeql_select_computable_33(self):
             SELECT Z {name, asdf_id := .asdf.id} FILTER .name = 'Elvis';
             """,
             [
-                {'name': 'Elvis', 'asdf_id': {}},
+                {'name': 'Elvis', 'asdf_id': str},
             ]
         )
 
@@ -3420,8 +3420,8 @@ async def test_edgeql_select_and_09(self):
             [
                 {'name': 'circle', 'val': 2, 'x': False},
                 {'name': 'hexagon', 'val': 4, 'x': True},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': False},
             ],
         )
@@ -3438,8 +3438,8 @@ async def test_edgeql_select_and_10(self):
             [
                 {'name': 'circle', 'val': 2, 'x': True},
                 {'name': 'hexagon', 'val': 4, 'x': False},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': True},
             ],
         )
@@ -3461,11 +3461,11 @@ async def test_edgeql_select_and_11(self):
                 'x': [False, False],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -3496,11 +3496,11 @@ async def test_edgeql_select_and_12(self):
                 'x': [True, True],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -3766,8 +3766,8 @@ async def test_edgeql_select_or_16(self):
             [
                 {'name': 'circle', 'val': 2, 'x': True},
                 {'name': 'hexagon', 'val': 4, 'x': True},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': False},
             ],
         )
@@ -3784,8 +3784,8 @@ async def test_edgeql_select_or_17(self):
             [
                 {'name': 'circle', 'val': 2, 'x': False},
                 {'name': 'hexagon', 'val': 4, 'x': False},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': True},
             ],
         )
@@ -3807,11 +3807,11 @@ async def test_edgeql_select_or_18(self):
                 'x': [False, True],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -3842,11 +3842,11 @@ async def test_edgeql_select_or_19(self):
                 'x': [False, True],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -3929,8 +3929,8 @@ async def test_edgeql_select_not_04(self):
             [
                 {'name': 'circle', 'val': 2, 'x': False},
                 {'name': 'hexagon', 'val': 4, 'x': False},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': True},
             ],
         )
@@ -3946,8 +3946,8 @@ async def test_edgeql_select_not_04(self):
             [
                 {'name': 'circle', 'val': 2, 'x': True},
                 {'name': 'hexagon', 'val': 4, 'x': True},
-                {'name': 'pentagon', 'val': {}, 'x': {}},
-                {'name': 'square', 'val': {}, 'x': {}},
+                {'name': 'pentagon', 'val': None, 'x': None},
+                {'name': 'square', 'val': None, 'x': None},
                 {'name': 'triangle', 'val': 10, 'x': False},
             ],
         )
@@ -3968,11 +3968,11 @@ async def test_edgeql_select_not_05(self):
                 'x': [False, True],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -3999,11 +3999,11 @@ async def test_edgeql_select_not_05(self):
                 'x': [False, True],
             }, {
                 'name': 'hexagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'pentagon',
-                'tags': {},
+                'tags': [],
                 'x': [],
             }, {
                 'name': 'square',
@@ -4281,15 +4281,15 @@ async def test_edgeql_select_cross_12(self):
                 <str>Issue.time_estimate
             );
             """,
-            [{}],
+            [1],
         )
 
     async def test_edgeql_select_cross_13(self):
         await self.assert_query_result(
             r"""
-            SELECT count(count( Issue.watchers));
+            SELECT count(count(Issue.watchers));
             """,
-            [{}],
+            [1],
         )
 
         await self.assert_query_result(
@@ -6719,28 +6719,28 @@ async def test_edgeql_collection_shape_01(self):
             r'''
                 SELECT <array<User>>{} UNION [User]
             ''',
-            [[{"id": {}}], [{"id": {}}]],
+            [[{"id": str}], [{"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <array<User>>{} ?? [User]
             ''',
-            [[{"id": {}}], [{"id": {}}]],
+            [[{"id": str}], [{"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <array<User>>{} IF false ELSE [User]
             ''',
-            [[{"id": {}}], [{"id": {}}]],
+            [[{"id": str}], [{"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT assert_exists([User])
             ''',
-            [[{"id": {}}], [{"id": {}}]],
+            [[{"id": str}], [{"id": str}]],
         )
 
     async def test_edgeql_collection_shape_02(self):
@@ -6748,28 +6748,28 @@ async def test_edgeql_collection_shape_02(self):
             r'''
                 SELECT <array<User>>{} UNION array_agg(User)
             ''',
-            [[{"id": {}}, {"id": {}}]],
+            [[{"id": str}, {"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <array<User>>{} ?? array_agg(User)
             ''',
-            [[{"id": {}}, {"id": {}}]],
+            [[{"id": str}, {"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <array<User>>{} IF false ELSE array_agg(User)
             ''',
-            [[{"id": {}}, {"id": {}}]],
+            [[{"id": str}, {"id": str}]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT assert_exists(array_agg(User))
             ''',
-            [[{"id": {}}, {"id": {}}]],
+            [[{"id": str}, {"id": str}]],
         )
 
     async def test_edgeql_collection_shape_03(self):
@@ -6777,28 +6777,28 @@ async def test_edgeql_collection_shape_03(self):
             r'''
                 SELECT <tuple<User, int64>>{} UNION (User, 2)
             ''',
-            [[{"id": {}}, 2], [{"id": {}}, 2]],
+            [[{"id": str}, 2], [{"id": str}, 2]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <tuple<User, int64>>{} ?? (User, 2)
             ''',
-            [[{"id": {}}, 2], [{"id": {}}, 2]],
+            [[{"id": str}, 2], [{"id": str}, 2]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT <tuple<User, int64>>{} IF false ELSE (User, 2)
             ''',
-            [[{"id": {}}, 2], [{"id": {}}, 2]],
+            [[{"id": str}, 2], [{"id": str}, 2]],
         )
 
         await self.assert_query_result(
             r'''
                 SELECT assert_exists((User, 2))
             ''',
-            [[{"id": {}}, 2], [{"id": {}}, 2]],
+            [[{"id": str}, 2], [{"id": str}, 2]],
         )
 
     async def test_edgeql_collection_shape_04(self):
@@ -6806,7 +6806,7 @@ async def test_edgeql_collection_shape_04(self):
             r'''
                 SELECT [(User,)][0]
             ''',
-            [[{"id": {}}], [{"id": {}}]]
+            [[{"id": str}], [{"id": str}]]
         )
 
         await self.assert_query_result(
@@ -6821,7 +6821,7 @@ async def test_edgeql_collection_shape_05(self):
             r'''
                 SELECT ([User],).0
             ''',
-            [[{"id": {}}], [{"id": {}}]]
+            [[{"id": str}], [{"id": str}]]
         )
 
         await self.assert_query_result(
@@ -6837,7 +6837,7 @@ async def test_edgeql_collection_shape_06(self):
                 SELECT { z := ([User],).0 }
             ''',
             [
-                {"z": [[{"id": {}}], [{"id": {}}]]}
+                {"z": [[{"id": str}], [{"id": str}]]}
             ]
         )
 
@@ -6847,7 +6847,7 @@ async def test_edgeql_collection_shape_07(self):
                 WITH Z := (<array<User>>{} IF false ELSE [User]),
                 SELECT (Z, array_agg(array_unpack(Z))).1;
             ''',
-            [[{"id": {}}], [{"id": {}}]]
+            [[{"id": str}], [{"id": str}]]
         )
 
         await self.assert_query_result(
@@ -6855,7 +6855,7 @@ async def test_edgeql_collection_shape_07(self):
                 WITH Z := (SELECT assert_exists([User]))
                 SELECT (Z, array_agg(array_unpack(Z))).1;
             ''',
-            [[{"id": {}}], [{"id": {}}]]
+            [[{"id": str}], [{"id": str}]]
         )
 
     async def test_edgeql_assert_fail_object_computed_01(self):
diff --git a/tests/test_edgeql_update.py b/tests/test_edgeql_update.py
--- a/tests/test_edgeql_update.py
+++ b/tests/test_edgeql_update.py
@@ -1871,7 +1871,7 @@ async def test_edgeql_update_empty_01(self):
             r"""
                 SELECT UpdateTest.comment;
             """,
-            {},
+            [],
         )
 
     async def test_edgeql_update_empty_02(self):
@@ -1914,7 +1914,7 @@ async def test_edgeql_update_empty_04(self):
             r"""
                 SELECT UpdateTest.status;
             """,
-            {},
+            [],
         )
 
     async def test_edgeql_update_empty_05(self):
diff --git a/tests/test_edgeql_volatility.py b/tests/test_edgeql_volatility.py
--- a/tests/test_edgeql_volatility.py
+++ b/tests/test_edgeql_volatility.py
@@ -889,8 +889,8 @@ async def test_edgeql_volatility_select_hard_objects_09(self):
             };
         ''', [
             {
-                'foo': [{"id": {}}, {"id": {}}, {"id": {}}],
-                'bar': [{"id": {}}, {"id": {}}, {"id": {}}],
+                'foo': [{"id": str}, {"id": str}, {"id": str}],
+                'bar': [{"id": str}, {"id": str}, {"id": str}],
             }
         ])