Girdileri zip ile eşlemek
Ekibinin, dosyaları belirli bulut depolama konumlarına yükleyen bir veri hattı var. Bir iş arkadaşın, her dosyayı ilgili bulut depolama hedefiyle eşlemek için expand_kwargs() ile birlikte zip() kullanıyor:
@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 kaç tane upload örneği oluşturur?
Bu egzersiz, kursun bir parçasıdır
Airflow ile Veri İş Hatları Oluşturma
Uygulamalı etkileşimli egzersiz
Teoriyi etkileşime dönüştürün, interaktif egzersizlerimizden biriyle
Egzersize başla