From 5ddca88808527c5e493de96d8f491156a2416025 Mon Sep 17 00:00:00 2001 From: uiro-bi Date: Thu, 31 Oct 2024 12:50:00 -0300 Subject: [PATCH] fix: clean_data_and_make_partitions function --- pipelines/datasets/br_cvm_fi/tasks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipelines/datasets/br_cvm_fi/tasks.py b/pipelines/datasets/br_cvm_fi/tasks.py index 1cfd89077..b6b19ebb7 100644 --- a/pipelines/datasets/br_cvm_fi/tasks.py +++ b/pipelines/datasets/br_cvm_fi/tasks.py @@ -225,8 +225,13 @@ def clean_data_and_make_partitions(path: str, table_id: str) -> str: for file in files: df = pd.read_csv(f"{path}{file}", sep=";") log(f"File {file} read.") + + df.rename(columns={'CNPJ_FUNDO_CLASSE':'CNPJ_FUNDO'}, inplace=True) + df["CNPJ_FUNDO"] = df["CNPJ_FUNDO"].str.replace(r"[/.-]", "") + df = rename_columns(df_arq, df) + df = check_and_create_column( df, colunas_totais=cvm_constants.COLUNAS_FINAL_INF.value )