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

ephraimanierobi 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 7ed78dcd0be Clean up import error records during DB migration (#51472)
7ed78dcd0be is described below

commit 7ed78dcd0beffefaa06918c9458de94193fed81e
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Sat Jun 7 11:06:58 2025 +0100

    Clean up import error records during DB migration (#51472)
    
    * Clean up import error records during DB migration
    
    This PR adds an SQL to clean up import errors during add bundle migration
    
    The bug we found was that import errors with null bundle_name field
    doesn't get cleared after migration. The processor manager's 
`clear_orphaned_import_errors` method
    filters by bundle_name and that makes the import errors with null 
bundle_name not to be included
    in the method's result
    
    * fixup! Clean up import error records during DB migration
---
 airflow-core/docs/img/airflow_erd.sha256                                | 2 +-
 .../src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow-core/docs/img/airflow_erd.sha256 
b/airflow-core/docs/img/airflow_erd.sha256
index 707398c1ba6..51c2117fd5b 100644
--- a/airflow-core/docs/img/airflow_erd.sha256
+++ b/airflow-core/docs/img/airflow_erd.sha256
@@ -1 +1 @@
-e7944da8d5f938084cf3b055a0380492ee2a61154ef54801397bb5167f975d6d
\ No newline at end of file
+173317aa67c36d8a257bc31c99eeedf906390cebdd9c6941d6e9c3db0515d5c5
\ No newline at end of file
diff --git 
a/airflow-core/src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py 
b/airflow-core/src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py
index 74485df9f14..786bd6eb7d0 100644
--- 
a/airflow-core/src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py
+++ 
b/airflow-core/src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py
@@ -63,6 +63,8 @@ def upgrade():
     with op.batch_alter_table("dag_version", schema=None) as batch_op:
         batch_op.add_column(sa.Column("bundle_name", StringID()))
         batch_op.add_column(sa.Column("bundle_version", StringID()))
+    # delete import_error table rows
+    op.get_bind().execute(sa.text("DELETE FROM import_error"))
 
 
 def downgrade():

Reply via email to