uranusjr commented on code in PR #48234:
URL: https://github.com/apache/airflow/pull/48234#discussion_r2024343849


##########
airflow-core/src/airflow/migrations/versions/0047_3_0_0_add_dag_versioning.py:
##########
@@ -48,49 +45,35 @@
 airflow_version = "3.0.0"
 
 
-def _delete_serdag_and_code():
-    op.execute(sa.text("DELETE FROM serialized_dag"))
-    op.execute(sa.text("DELETE FROM dag_code"))
-
-
-# The below tables helps us use the recreate_always feature of 
batch_alter_table and makes
-# this migration work in offline mode.
-old_dagcode_table = Table(
-    "dag_code",
-    sa.MetaData(naming_convention=naming_convention),
-    sa.Column("fileloc_hash", sa.BigInteger(), nullable=False, 
primary_key=True),
-    sa.Column("fileloc", sa.String(length=2000), nullable=False),
-    sa.Column("last_updated", UtcDateTime(), nullable=False),
-    sa.Column("source_code", sa.Text().with_variant(MEDIUMTEXT(), "mysql"), 
nullable=False),
-)
-
-old_serialized_table = Table(
-    "serialized_dag",
-    sa.MetaData(naming_convention=naming_convention),
-    sa.Column("dag_id", sa.String(ID_LEN), nullable=False, primary_key=True),
-    sa.Column("fileloc", sa.String(length=2000), nullable=False),
-    sa.Column("fileloc_hash", sa.BigInteger(), nullable=False),
-    sa.Column("data", sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True),
-    sa.Column("data_compressed", LargeBinary, nullable=True),
-    sa.Column("dag_hash", sa.String(32), nullable=False),
-    sa.Column("last_updated", UtcDateTime(), nullable=False),
-    sa.Column("processor_subdir", sa.String(2000)),
-    sa.Index("idx_fileloc_hash", "fileloc_hash", unique=False),
-)
+def _get_rows(sql, conn):
+    stmt = sa.text(sql)
+    rows = conn.execute(stmt)
+    if rows:
+        rows = rows.fetchall()
+    else:
+        rows = []

Review Comment:
   When does this happen? I though `execute` always returns a result.



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