ephraimbuddy commented on code in PR #30495:
URL: https://github.com/apache/airflow/pull/30495#discussion_r1163375803
##########
airflow/dag_processing/processor.py:
##########
@@ -187,6 +188,18 @@ def _handle_dag_file_processing():
def start(self) -> None:
"""Launch the process and start processing the DAG."""
+ import importlib
+
+ for module in iter_airflow_imports(self.file_path):
+ try:
+ importlib.import_module(module)
+ except Exception as e:
+ # only log as warning because an error here is not preventing
anything from working,
+ # and if it's serious, it's going to be surfaced to the user
when the dag is actually parsed.
+ self.log.warning(
+ "error when try to pre-import module '%s' found in %s:
%s", module, self.file_path, e
Review Comment:
```suggestion
"Error when trying to pre-import module '%s' found in
%s: %s", module, self.file_path, e
```
--
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]