astahlman commented on a change in pull request #4730: [AIRFLOW-3885] ~10x 
speed-up of SchedulerJobTest suite
URL: https://github.com/apache/airflow/pull/4730#discussion_r257864545
 
 

 ##########
 File path: airflow/utils/dag_processing.py
 ##########
 @@ -277,7 +277,7 @@ def get_dag(self, dag_id):
 
 
 def list_py_file_paths(directory, safe_mode=True,
-                       include_examples=conf.getboolean('core', 
'LOAD_EXAMPLES')):
+                       include_examples=None):
 
 Review comment:
   This was needed because of [the way that Python handles default 
arguments](https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments):
 the default value is evaluated when the function is defined, not when it is 
called. Therefore, our mocked implementation of `getboolean` wouldn't get 
called here, and `include_examples` will be always be `True`.
   
   This way, we call `getboolean` every time the function is evaluated, so our 
mock implementation does get used and `getboolean('core', 'LOAD_EXAMPLES')` 
evaluates to `False`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to