From c3c588359dbc46c7c86c3bcdca59f397deecc18c Mon Sep 17 00:00:00 2001 From: Luciano Filho Date: Sat, 7 Oct 2023 13:10:47 -0300 Subject: [PATCH] push --- app/ETL/extract.py | 2 +- app/ETL/load.py | 4 ++-- tests/test_unitarios.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/ETL/extract.py b/app/ETL/extract.py index 527690a..f075adc 100644 --- a/app/ETL/extract.py +++ b/app/ETL/extract.py @@ -15,5 +15,5 @@ def extract_excel(input_folder): files = glob.glob(os.path.join(input_folder, "*.xlsx")) if not files: raise ValueError("No Excel files found in the specified folder") - all_data = [pd.read_excel(file) for file in files] + all_data = [pd.read_excel(file) for file in file] return all_data diff --git a/app/ETL/load.py b/app/ETL/load.py index 5c67141..65903a2 100644 --- a/app/ETL/load.py +++ b/app/ETL/load.py @@ -12,6 +12,6 @@ def load_em_um_novo_excel(df, output_folder, output_file_name): if not os.path.exists(output_folder): os.makedirs(output_folder) - df.to_excel( - os.path.join(output_folder, output_file_name), index=False + df.to_parquet( + os.path.join(output_folder, output_file_name), index=True ) # Retirado engine='openpyxl' diff --git a/tests/test_unitarios.py b/tests/test_unitarios.py index f29060f..03441d3 100644 --- a/tests/test_unitarios.py +++ b/tests/test_unitarios.py @@ -37,7 +37,7 @@ def mock_output_folder(tmpdir): def test_extract(mock_input_folder): """Test the extraction of data from the input folder.""" extracted_data = extract_excel(mock_input_folder) - assert len(extracted_data) == 2 # Expecting two DataFrames + assert len(extracted_data) == 3 # Expecting two DataFrames assert all(isinstance(df, pd.DataFrame) for df in extracted_data)