1. 학습
  2. /
  3. 강의
  4. /
  5. Python으로 배우는 Apache Airflow 입문

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.