From bf51c34e5487b8d6af96d434a47aefbfd51bc03c Mon Sep 17 00:00:00 2001 From: Lucien Gaitskell Date: Wed, 20 Jul 2022 17:57:43 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20sub-processing=20of=20=E2=80=98MERGE=20IN?= =?UTF-8?q?TO=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/snowflake/sqlalchemy/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/snowflake/sqlalchemy/base.py b/src/snowflake/sqlalchemy/base.py index 4d3386ba..a3a7edd8 100644 --- a/src/snowflake/sqlalchemy/base.py +++ b/src/snowflake/sqlalchemy/base.py @@ -157,10 +157,11 @@ def visit_merge_into(self, merge_into, **kw): clauses = " ".join( clause._compiler_dispatch(self, **kw) for clause in merge_into.clauses ) - return ( - f"MERGE INTO {merge_into.target} USING {merge_into.source} ON {merge_into.on}" - + (" " + clauses if clauses else "") - ) + return "MERGE INTO %s USING %s ON %s" % ( + self.process(merge_into.target, asfrom=True, **kw), + self.process(merge_into.source, asfrom=True, **kw), + self.process(merge_into.on, **kw), + ) + (" " + clauses if clauses else "") def visit_merge_into_clause(self, merge_into_clause, **kw): if merge_into_clause.command == "INSERT":