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

jedcunningham 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 0d5b089c76 Fix pre-commit inserting airflow_version var (#42378)
0d5b089c76 is described below

commit 0d5b089c763bd9437323e954c8123c931420b4e2
Author: Daniel Standish <[email protected]>
AuthorDate: Fri Sep 20 11:15:21 2024 -0700

    Fix pre-commit inserting airflow_version var (#42378)
---
 scripts/in_container/run_migration_reference.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/scripts/in_container/run_migration_reference.py 
b/scripts/in_container/run_migration_reference.py
index a819c685e7..2322de9d50 100755
--- a/scripts/in_container/run_migration_reference.py
+++ b/scripts/in_container/run_migration_reference.py
@@ -97,14 +97,13 @@ def insert_version(old_content, file, app):
             old_content,
             flags=re.MULTILINE,
         )
-        return
-
-    new_content = re.sub(
-        r"(^depends_on.*)",
-        lambda x: f'{x.group(1)}\nfab_version = "{fab_version}"',
-        old_content,
-        flags=re.MULTILINE,
-    )
+    else:
+        new_content = re.sub(
+            r"(^depends_on.*)",
+            lambda x: f'{x.group(1)}\nfab_version = "{fab_version}"',
+            old_content,
+            flags=re.MULTILINE,
+        )
     file.write_text(new_content)
 
 

Reply via email to