potiuk commented on a change in pull request #17195:
URL: https://github.com/apache/airflow/pull/17195#discussion_r675715236
##########
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
+ except ImportError as e:
+ log.critical("Failed to import airflow_local_settings.", exc_info=True)
+ raise e
Review comment:
```suggestion
raise
```
##########
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:
```suggestion
raise
```
--
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]