Copilot commented on code in PR #64929:
URL: https://github.com/apache/airflow/pull/64929#discussion_r3069969097


##########
airflow-core/src/airflow/dag_processing/collection.py:
##########
@@ -460,6 +466,8 @@ def update_dag_parsing_results_in_db(
     # Retry 'DAG.bulk_write_to_db' & 'SerializedDagModel.bulk_sync_to_db' in 
case
     # of any Operational Errors
     # In case of failures, provide_session handles rollback
+    from airflow.models.serialized_dag import SerializedDagModel
+

Review Comment:
   `update_dag_parsing_results_in_db` adds a new in-function import (`from 
airflow.models.serialized_dag import SerializedDagModel`). This file already 
imports `SerializedDagModel` inside `_serialize_dag_capturing_errors`, so this 
is duplicated and increases the number of local imports on a hot path. Prefer a 
single module-level import (or a single justified local import) and reuse it 
here to avoid repetition and align with the project's import-at-top convention.



-- 
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]

Reply via email to