potiuk commented on a change in pull request #6601: [AIRFLOW-6010] Settings are not used for DAG context management URL: https://github.com/apache/airflow/pull/6601#discussion_r348189503
########## 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: @ashb @feluelle . As mentioned in slack I went back to the drawing board and looked more closely into the problems and I would like to introduce a series of commits that will solve it better than I initially thought. Indeed local import in settings kind of masked the problem, so I went back to see what was the real problem if we leave it as it was. I think the main problem was really the CONTEXT_MANAGER_DAG in settings and especially the type annotation there for the DAG class. This was the main problem with settings. So I left in this commit/PR and changed JIRA to reflect it is only to move the DAG context manager to DAG. It's much smaller and less disruptive and would not require to change any of the user's patterns (such as importing settings). This is the first step, more will follow. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
