initial stage
This commit is contained in:
parent
5fceeb8b61
commit
d7e3e7a1b7
|
@ -37,8 +37,11 @@ def s3_untar():
|
|||
s3_obj = hook.get_key(context["params"]["src_key"], bucket_name=context["params"]["src_bucket"])
|
||||
with tarfile.open(fileobj=s3_obj.get()["Body"], mode='r|') as tar:
|
||||
for member in tar:
|
||||
hook.load_file_obj(tar.extractfile(member.name),
|
||||
context["params"]["dst_key_prefix"] + member.name,
|
||||
dst_key = context["params"]["dst_key_prefix"] + member.name
|
||||
dst_key = dst_key.replace('//', '/')
|
||||
print(f"Extracting {member.name} to {dst_key}")
|
||||
hook.load_file_obj(tar.extractfile(member),
|
||||
dst_key,
|
||||
context["params"]["dst_bucket"],
|
||||
replace=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue