From 806227f2028d0591a6b1de6fed24265fb682cf6d Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sat, 30 Dec 2023 17:45:15 +0100 Subject: [PATCH] Feat: add logging in join --- pdf_oralia/join.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pdf_oralia/join.py b/pdf_oralia/join.py index dcaa5ce..f776132 100644 --- a/pdf_oralia/join.py +++ b/pdf_oralia/join.py @@ -10,7 +10,9 @@ def join_excel(src, dest, file_pattern): logging.debug(f"Concatenate {filenames}") dfs = extract_dfs(filenames) joined_df = pd.concat(dfs) + logging.debug(f"Writing joined excel to {dest}") joined_df.to_excel(dest, index=False) + logging.debug(f"with {len(joined_df)} rows") def list_files(src, file_glob): @@ -20,5 +22,8 @@ def list_files(src, file_glob): def extract_dfs(filenames): dfs = [] for filename in filenames: - dfs.append(pd.read_excel(filename)) + logging.debug(f"Extracting {filename}") + df = pd.read_excel(filename) + logging.debug(f"Found {len(df)} rows") + dfs.append(df) return dfs