1. Обучение
  2. /
  3. Курса
  4. /
  5. Introduction to Apache Airflow in Python

Connected

упражнение

Creating a FileSensor

After reading about FileSensors, you decide to try to implement a basic one to get a feel for some of the parameters used with them. This FileSensor will be designed to make sure a specific datafile is present before continuing.

A FileSensor polls for the file at a regular interval and stops waiting once timeout seconds have elapsed. With mode='reschedule', the worker slot is released between polls.

Инструкции

100 XP
  • Import the appropriate library to use a FileSensor.
  • Set the precheck reference to the FileSensor object.
  • Make the FileSensor look for the file "salesdata_ready.csv".
  • Set the timeout to 5 minutes.