You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vandonr-amz (via GitHub)" <gi...@apache.org> on 2023/04/06 16:38:45 UTC

[GitHub] [airflow] vandonr-amz commented on a diff in pull request #30495: preload airflow imports before dag parsing to save time

vandonr-amz commented on code in PR #30495:
URL: https://github.com/apache/airflow/pull/30495#discussion_r1160029424


##########
airflow/dag_processing/processor.py:
##########
@@ -187,6 +188,12 @@ def _handle_dag_file_processing():
 
     def start(self) -> None:
         """Launch the process and start processing the DAG."""
+        import importlib
+
+        modules = get_airflow_modules_in(self.file_path)
+        for module in modules:
+            importlib.import_module(module)

Review Comment:
   yes you're right, better catch it and let it error during dag evaluation like it currently does to keep it consistent



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org