From 45b04a635b283f7e3eba42b40092f8d166a5c097 Mon Sep 17 00:00:00 2001 From: Ivan Vazhenin Date: Fri, 10 Nov 2023 09:50:51 +0700 Subject: [PATCH] Fix downloading file from s3 --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1725e8d..3fa7934 100644 --- a/main.py +++ b/main.py @@ -300,7 +300,9 @@ def replication(bnd_name: str, commit_id: str, schema: str): 'bucket': x.bucket, 'filename': x.fileName, }) - download_file(x.key, x.bucket, os.path.join(z.dirname, x.key)) + fp = os.path.join(z.dirname, x.key) + os.makedirs(os.path.dirname(fp), exist_ok=True) + download_file(x.key, x.bucket, fp) with open(os.path.join(z.dirname, 'export_files.json'), 'w') as f: f.write(json.dumps(exported_files)) ws.clearData(True)