pgagnon 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_r289808857
##########
File path: airflow/settings.py
##########
@@ -251,16 +251,24 @@ 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():
+ import airflow_local_settings
+
+ for k, v in airflow_local_settings.__dict__.items():
+ if not k.startswith("__") and not k.endswith("__"):
+ globals()[k] = v
Review comment:
Unfortunately yes, because wild imports are not allow at the function level:
`SyntaxError: import * only allowed at module level`.
The logic on line 258 could be improved though, but I'm not sure what would
work best.
----------------------------------------------------------------
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