BaşlayınÜcretsiz Başlayın

Schedule a Dag via Python

You've learned quite a bit about creating Dags, but now you would like to schedule a specific Dag on a specific day of the week at a certain time. You'd like the code to include this information in case a colleague needs to reinstall the Dag to a different server.

The Airflow dag object and the appropriate datetime methods have been imported for you.

Bu egzersiz

Python ile Apache Airflow'a Giriş

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Set the start date of the Dag to November 1, 2025.
  • Use the cron syntax to configure a schedule of every Wednesday at 12:30pm.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

@dag(
  dag_id='update_dataflows',
  # Set to November 1, 2025
  start_date=datetime(____),
  # Every Wednesday at 12:30pm
  schedule='____'
)
def update_dataflows():
  @task
  def pull_source_data():
    pass
  
update_dataflows()
Kodu Düzenle ve Çalıştır