Feat: add logging in join

This commit is contained in:
Bertrand Benjamin 2023-12-30 17:45:15 +01:00
parent 7bf0c38883
commit 806227f202
1 changed files with 6 additions and 1 deletions

View File

@ -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