From 3effb2dfa128320f460d225b78370ba09984464b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 24 Jan 2024 18:30:22 +0100 Subject: [PATCH] cqa --- edb/pgsql/compiler/relctx.py | 2 +- edb/pgsql/delta.py | 4 ++-- edb/schema/pointers.py | 2 -- tests/test_edgeql_ddl.py | 8 +++++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/edb/pgsql/compiler/relctx.py b/edb/pgsql/compiler/relctx.py index 9a0255308f7..37d878af4e9 100644 --- a/edb/pgsql/compiler/relctx.py +++ b/edb/pgsql/compiler/relctx.py @@ -743,7 +743,7 @@ def create_iterator_identity_for_path( if apply_volatility: apply_volatility_ref(stmt, ctx=ctx) - if (path_id, 'iterator') not in stmt.path_rvar_map: + if (path_id, 'iterator') not in stmt.path_namespace: id_expr = pgast.FuncCall( name=('edgedb', 'uuid_generate_v4'), args=[], diff --git a/edb/pgsql/delta.py b/edb/pgsql/delta.py index c10e74e7ea6..8193d426e4a 100644 --- a/edb/pgsql/delta.py +++ b/edb/pgsql/delta.py @@ -4588,7 +4588,7 @@ def _alter_pointer_type(self, pointer, schema, orig_schema, context): aux_ptr_col = None source_rel_alias = f'source_{uuidgen.uuid1mc()}' - source_rel_alias = f'source_rel' # DEBUG + source_rel_alias = f'source_rel' # DEBUG source_rel = f'''SELECT *, ctid FROM {tab}''' source_iter_col = 'id' if ptr_table: @@ -4778,7 +4778,7 @@ def _compile_conversion_expr( Contract when produce_ctes=True: - Must be provided with alias of "iterator" rel - the relation that contains a row for each of the evaluations for the USING expression. - - Must be provided with alias of "source" rel - the relation that + - Must be provided with alias of "source" rel - the relation that contains all columns of the subject ObjectType. - Result is SQL string that contains CTEs, last of which has following signature: _conv_rel (val, iter) diff --git a/edb/schema/pointers.py b/edb/schema/pointers.py index a4a235ce5ca..64aab157805 100644 --- a/edb/schema/pointers.py +++ b/edb/schema/pointers.py @@ -2440,8 +2440,6 @@ def _alter_begin( schema: s_schema.Schema, context: sd.CommandContext, ) -> s_schema.Schema: - from edb.ir import utils as irutils - orig_schema = schema orig_rec = context.current().enable_recursion context.current().enable_recursion = False diff --git a/tests/test_edgeql_ddl.py b/tests/test_edgeql_ddl.py index 9ed60ba47e2..38298103ad8 100644 --- a/tests/test_edgeql_ddl.py +++ b/tests/test_edgeql_ddl.py @@ -3036,9 +3036,11 @@ async def test_edgeql_ddl_ptr_using_dml_03(self): """ ) + # only one Goodbye object, as only one link exists, so only one cast is + # performed await self.assert_query_result( 'select Goodbye', - [{}] # a single object, as only one link exists and needs to be cast + [{}] ) await self.assert_query_result( 'select World { hell }', @@ -3082,7 +3084,7 @@ async def test_edgeql_ddl_ptr_using_dml_05(self): """ ) await self.assert_query_result( - 'SELECT World { foo }', + 'SELECT World { foo }', [{"foo": "hello"}] ) @@ -3095,7 +3097,7 @@ async def test_edgeql_ddl_ptr_using_dml_05(self): """ ) await self.assert_query_result( - 'SELECT World { foo, hell: { bar } }', + 'SELECT World { foo, hell: { bar } }', [{"foo": "hello", "hell": {"bar": "hello world"}}] )