You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2017/09/16 15:22:17 UTC
incubator-airflow git commit: [AIRFLOW-1614] Replace inspect.stack()
with sys._getframe()
Repository: incubator-airflow
Updated Branches:
refs/heads/master b6d2e0a46 -> 558198e1b
[AIRFLOW-1614] Replace inspect.stack() with sys._getframe()
inspect.stack() is really expensive, and slows
down processing of dags
having large numbers (100s, 1000s) of subdags.
Closes #2610 from gbenison/gcbenison2
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/558198e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/558198e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/558198e1
Branch: refs/heads/master
Commit: 558198e1b7a6f2839498987a9692b4c5d421fb8f
Parents: b6d2e0a
Author: Gregory Benison <gb...@comscore.com>
Authored: Sat Sep 16 17:21:31 2017 +0200
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Sat Sep 16 17:21:48 2017 +0200
----------------------------------------------------------------------
airflow/models.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/558198e1/airflow/models.py
----------------------------------------------------------------------
diff --git a/airflow/models.py b/airflow/models.py
index 20d750e..d88c997 100755
--- a/airflow/models.py
+++ b/airflow/models.py
@@ -31,7 +31,6 @@ import getpass
import imp
import importlib
import itertools
-import inspect
import zipfile
import jinja2
import json
@@ -2859,7 +2858,7 @@ class DAG(BaseDag, LoggingMixin):
self._description = description
# set file location to caller source path
- self.fileloc = inspect.getsourcefile(inspect.stack()[1][0])
+ self.fileloc = sys._getframe().f_back.f_code.co_filename
self.task_dict = dict()
self.start_date = start_date
self.end_date = end_date