baryluk commented on a change in pull request #17195:
URL: https://github.com/apache/airflow/pull/17195#discussion_r675720601
##########
File path: airflow/settings.py
##########
@@ -431,8 +431,15 @@ def import_local_settings():
del globals()["policy"]
log.info("Loaded airflow_local_settings from %s .",
airflow_local_settings.__file__)
- except ImportError:
- log.debug("Failed to import airflow_local_settings.", exc_info=True)
+ except ModuleNotFoundError as e:
+ if e.name == "airflow_local_settings":
+ log.debug("No airflow_local_settings to import.", exc_info=True)
+ else:
+ log.critical("Failed to import airflow_local_settings due to a
transitive module not found error.", exc_info=True)
+ raise e
Review comment:
Thanks, that is indeed better. I was not aware of that feature of Python.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]