From 470e45b7f0af659284faaf9e3c460260050ace7c Mon Sep 17 00:00:00 2001 From: d116626 Date: Mon, 23 Oct 2023 10:45:49 -0300 Subject: [PATCH 1/2] chore: change overwrite mode --- pipelines/utils/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipelines/utils/tasks.py b/pipelines/utils/tasks.py index 0307bd645..7917853e2 100644 --- a/pipelines/utils/tasks.py +++ b/pipelines/utils/tasks.py @@ -230,7 +230,8 @@ def create_table_and_upload_to_gcs( f"{storage_path}\n" f"{storage_path_link}" ) # pylint: disable=C0301 - tb.delete(mode="all") + # delete only staging table and let DBT overwrite the prod table + tb.delete(mode="staging") log( "MODE OVERWRITE: Sucessfully DELETED TABLE:\n" f"{table_staging}\n" From 5038d612392bcb194ebb40d7ced4701c8e832157 Mon Sep 17 00:00:00 2001 From: d116626 Date: Mon, 23 Oct 2023 11:34:42 -0300 Subject: [PATCH 2/2] chore: change overwrite mode --- pipelines/rj_smfp/dump_db_sigma/flows.py | 2 +- pipelines/utils/tasks.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pipelines/rj_smfp/dump_db_sigma/flows.py b/pipelines/rj_smfp/dump_db_sigma/flows.py index 2743b5d30..cd5d8f67e 100644 --- a/pipelines/rj_smfp/dump_db_sigma/flows.py +++ b/pipelines/rj_smfp/dump_db_sigma/flows.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Database dumping flows for SMFP SIGMA system +Database dumping flows for SMFP SIGMA system. """ from copy import deepcopy diff --git a/pipelines/utils/tasks.py b/pipelines/utils/tasks.py index 7917853e2..15ea61f87 100644 --- a/pipelines/utils/tasks.py +++ b/pipelines/utils/tasks.py @@ -233,9 +233,7 @@ def create_table_and_upload_to_gcs( # delete only staging table and let DBT overwrite the prod table tb.delete(mode="staging") log( - "MODE OVERWRITE: Sucessfully DELETED TABLE:\n" - f"{table_staging}\n" - f"{tb.table_full_name['prod']}" + "MODE OVERWRITE: Sucessfully DELETED TABLE:\n" f"{table_staging}\n" ) # pylint: disable=C0301 # the header is needed to create a table when dosen't exist