시작하기무료로 시작하기

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 인스턴스를 몇 개 생성할까요?

이 연습은 강의의 일부입니다

Airflow로 데이터 파이프라인 구축하기

강의 보기

실습형 인터랙티브 연습문제

이론을 실습으로 바꾸는 인터랙티브 연습 중 하나를 만나보세요

연습 시작