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

Connected

упражнение

Reading a variable in Python

You've realized that using Variables within your Dags will allow a bit of control over the configuration in various environments, including your development and test Airflow servers. To keep from needing to update your Dag code for each, you decide to implement an Output_Path variable to store the location on your server where the various files are kept.

The dag and task objects have been imported for you, along with datetime.

Инструкции

100 XP
  • Import the library necessary to work with Variables.
  • Read the Output_Path variable from Airflow.
  • Provide a fallback value of /home if Output_Path is not defined.