joseangel-sc commented on a change in pull request #5330: [AIRFLOW-4573] Import
airflow_local_settings after prepare_classpath()
URL: https://github.com/apache/airflow/pull/5330#discussion_r287882858
##########
File path: airflow/settings.py
##########
@@ -251,16 +251,21 @@ def prepare_classpath():
sys.path.append(PLUGINS_FOLDER)
-try:
- from airflow_local_settings import * # noqa F403 F401
- log.info("Loaded airflow_local_settings.")
-except Exception:
- pass
+def import_local_settings():
+ try:
+ import airflow_local_settings
+ for k, v in airflow_local_settings.__dict__.items():
+ if not k.startswith("__") and not k.endswith("__"):
+ globals()[k] = v
+ log.info("Loaded airflow_local_settings.")
+ except Exception:
Review comment:
This is just a question, is this kind of exception the only way to do this?
Why is it so broad?
----------------------------------------------------------------
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