zip으로 입력값 짝짓기
팀에서 파일을 특정 클라우드 스토리지 위치에 업로드하는 파이프라인을 운영하고 있습니다. 동료가 zip()과 expand_kwargs()를 사용해 각 파일을 해당 클라우드 스토리지 대상과 짝지었습니다.
@task
def get_files():
return ["users.csv", "orders.csv", "products.csv"]
@task
def get_destinations():
return ["s3://bronze/users/", "s3://bronze/orders/", "s3://bronze/products/"]
@task
def upload(file_to_upload):
# Simulate uploading a file to cloud storage
print(f"Uploading {file_to_upload[0]} to {file_to_upload[1]}")
files = get_files()
destinations = get_destinations()
upload.expand(file_to_upload=files.zip(destinations))
Airflow는 upload 인스턴스를 몇 개 생성할까요?
이 연습은 강의의 일부입니다
