This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v1-10-stable
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-stable by this push:
new 69cc837 Fix task_instance_mutation_hook (#9910)
69cc837 is described below
commit 69cc8370e486e00dd526e96c2b0aacd348ee255e
Author: waleed <[email protected]>
AuthorDate: Wed Jul 22 16:25:16 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__)