Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
lvgalvao committed Oct 7, 2023
1 parent 8c0def8 commit c3c5883
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/ETL/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions app/ETL/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion tests/test_unitarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit c3c5883

Please sign in to comment.