[AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths

The use of utils.dag_processing.list_py_file_paths causes a failure if
utils.dag_processing is not already loaded indirectly.
This commit is contained in:
Kevin Yuen 2018-07-21 12:38:21 -04:00
Родитель 7f2bc0ddf7
Коммит ba5b67b6c9
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -79,6 +79,7 @@ from airflow.ti_deps.deps.trigger_rule_dep import TriggerRuleDep
from airflow.ti_deps.dep_context import DepContext, QUEUE_DEPS, RUN_DEPS
from airflow.utils import timezone
from airflow.utils.dag_processing import list_py_file_paths
from airflow.utils.dates import cron_presets, date_range as utils_date_range
from airflow.utils.db import provide_session
from airflow.utils.decorators import apply_defaults
@ -520,7 +521,7 @@ class DagBag(BaseDagBag, LoggingMixin):
stats = []
FileLoadStat = namedtuple(
'FileLoadStat', "file duration dag_num task_num dags")
for filepath in utils.dag_processing.list_py_file_paths(dag_folder):
for filepath in list_py_file_paths(dag_folder):
try:
ts = timezone.utcnow()
found_dags = self.process_file(