feluelle commented on a change in pull request #6601: [AIRFLOW-6010] Do not 
import airflow settings directly.
URL: https://github.com/apache/airflow/pull/6601#discussion_r348010222
 
 

 ##########
 File path: airflow/bin/cli.py
 ##########
 @@ -70,10 +70,18 @@
 
 LOG = LoggingMixin().log
 
-DAGS_FOLDER = settings.DAGS_FOLDER
 
-if "BUILDING_AIRFLOW_DOCS" in os.environ:
-    DAGS_FOLDER = '[AIRFLOW_HOME]/dags'
+def get_dags_folder():
+    """Retrieves DAGS_FOLDER to use."""
+    from airflow.settings import DAGS_FOLDER
 
 Review comment:
   > Pylint saying there is an import cycle is very different to there being an 
actual import cycle that will break running Python and cause a recursion error.
   
   That's [true](https://github.com/PyCQA/pylint/issues/850). 
   
   > Settings loads a lot of dependencies on its own and having it imported at 
the top of the file often causes many transitive/implicit dependencies which 
might cause circular imports.
   
   @potiuk isn't that then an issue with the settings module itself instead of 
the ones that are importing it? I would suggest that we split up those bigger 
modules into smaller ones.

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


With regards,
Apache Git Services

Reply via email to