airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-1614] Replace inspect.stack() with sys._getframe()
Date Sat, 16 Sep 2017 15:22:17 GMT
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 <gbenison@comscore.com>
Authored: Sat Sep 16 17:21:31 2017 +0200
Committer: Bolke de Bruin <bolke@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


Mime
View raw message