jason810496 commented on code in PR #63920:
URL: https://github.com/apache/airflow/pull/63920#discussion_r2973402407
##########
airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py:
##########
@@ -519,57 +644,124 @@ def _migrate_dag_deadlines(dag_conn: Connection) ->
Iterable[str]:
)
if not validate_written_data(
- dag_conn, deadline_alert_id, reference_data,
interval_data, callback_data
+ dag_conn,
+ deadline_alert_id,
+ reference_data,
+ interval_data,
+ callback_data,
):
dags_with_errors[dag_id].append(f"Invalid
DeadlineAlert data: {serialized_alert}")
continue
yield deadline_alert_id
- dag_conn.execute(
- sa.text("""
- UPDATE deadline
- SET deadline_alert_id = :alert_id
- WHERE dagrun_id IN (
+ # Fetch dagrun IDs once per DAG to avoid repeating the
+ # expensive dag_run/serialized_dag JOIN for every
alert.
+ dagrun_ids = [
Review Comment:
Nice catch! I oversaw when resolving the merge conflict, addressed in
[0b0f25d](https://github.com/apache/airflow/pull/63920/commits/0b0f25d41d91f3ded063263632acd90f3e91a0b8)
--
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]