You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/11 22:34:44 UTC

[airflow] 03/32: Fix task_instance_mutation_hook (#9910)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit e6b017aff28ef2f7c08998386e8221abe1b553de
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Jul 22 16:55:54 2020 +0200

    Fix task_instance_mutation_hook (#9910)
    
    Fixes #9902
---
 airflow/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/__init__.py b/airflow/__init__.py
index c8dcd21..287efe3 100644
--- a/airflow/__init__.py
+++ b/airflow/__init__.py
@@ -40,12 +40,14 @@ import sys
 from airflow import utils
 from airflow import settings
 from airflow.configuration import conf
-from airflow.models import DAG
 from flask_admin import BaseView
 from importlib import import_module
 from airflow.exceptions import AirflowException
 
 settings.initialize()
+# Delay the import of airflow.models to be after the settings initialization to make sure that
+# any reference to a settings' functions (e.g task_instance_mutation_hook) holds the expected implementation
+from airflow.models import DAG  # noqa: E402
 
 login = None  # type: Any
 log = logging.getLogger(__name__)