Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
chraibi committed Mar 13, 2024
1 parent fb20b18 commit 4068aa0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/classes/datafactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ def unzip_files(zip_path: Union[str, Path], destination: Union[str, Path]) -> No
"""
with zipfile.ZipFile(zip_path, "r") as zip_ref:
for member in zip_ref.infolist():
st.info(f"member: {member}")
# Extract only if file (ignores directories)
if not member.is_dir():
# Build target filename path
target_path = os.path.join(destination, os.path.basename(member.filename))
st.info(f"targe_path {target_path}")
# Ensure target directory exists (e.g., if not extracting directories)
os.makedirs(os.path.dirname(target_path), exist_ok=True)
# Extract file
Expand Down

0 comments on commit 4068aa0

Please sign in to comment.