This repository was archived by the owner on Mar 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,15 @@ def upsert_table(
150150
151151 deleted_column = f"EXCLUDED.{ Providers .AuditColumnsNames .IS_DELETED } "
152152 for column_config in columns_config :
153- if "preserve_after_delete" in column_config ["destination" ] and column_config ["destination" ]["preserve_after_delete" ]:
154- existing_column = f"{ target_table_name } .{ column_config ["destination" ]["name" ]} "
155- excluded_column = f"EXCLUDED.{ column_config ["destination" ]["name" ]} "
153+ if (
154+ "preserve_after_delete" in column_config ["destination" ]
155+ and column_config ["destination" ]["preserve_after_delete" ]
156+ ):
157+ col_name = column_config ["destination" ]["name" ]
158+ existing_column = f"{ target_table_name } .{ col_name } "
159+ excluded_column = f"EXCLUDED.{ col_name } "
156160 sql_builder .write (
157- f"{ column_config [ "destination" ][ "name" ] } = CASE WHEN { deleted_column } = TRUE THEN { existing_column } ELSE { excluded_column } END, \n "
161+ f"{ col_name } = CASE WHEN { deleted_column } = TRUE THEN { existing_column } ELSE { excluded_column } END, \n "
158162 )
159163 else :
160164 sql_builder .write (
You can’t perform that action at this time.
0 commit comments