This is an automated email from the ASF dual-hosted git repository.

phanikumv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new c4b11d579c6 fix mysql query of serialize_dag when migrating deadline 
(#63804)
c4b11d579c6 is described below

commit c4b11d579c65d66293297d31d76249b19e2c35db
Author: Jeongwoo Do <[email protected]>
AuthorDate: Tue Mar 17 22:34:20 2026 +0900

    fix mysql query of serialize_dag when migrating deadline (#63804)
---
 .../versions/0101_3_2_0_ui_improvements_for_deadlines.py          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py
 
b/airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py
index e5714e5fcae..91bed2ebe71 100644
--- 
a/airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py
+++ 
b/airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py
@@ -395,15 +395,15 @@ def 
migrate_existing_deadline_alert_data_from_serialized_dag() -> None:
                     INNER JOIN (
                         SELECT id, dag_id
                         FROM serialized_dag
-                        WHERE (data IS NOT NULL OR data_compressed IS NOT NULL)
-                          AND dag_id > :last_dag_id
+                        WHERE dag_id > :last_dag_id
                         ORDER BY dag_id
                         LIMIT :batch_size
                     ) AS subq ON sd.id = subq.id
-                    ORDER BY sd.dag_id
                 """),
                 {"last_dag_id": last_dag_id, "batch_size": BATCH_SIZE},
             )
+
+            batch_results = sorted(list(result), key=lambda r: r.dag_id)
         else:
             result = conn.execute(
                 sa.text("""
@@ -417,7 +417,7 @@ def 
migrate_existing_deadline_alert_data_from_serialized_dag() -> None:
                 {"last_dag_id": last_dag_id, "batch_size": BATCH_SIZE},
             )
 
-        batch_results = list(result)
+            batch_results = list(result)
         if not batch_results:
             break
 

Reply via email to