kaxil commented on code in PR #44790:
URL: https://github.com/apache/airflow/pull/44790#discussion_r1882554775


##########
airflow/migrations/versions/0038_3_0_0_add_asset_active.py:
##########
@@ -76,13 +72,11 @@ def downgrade():
         batch_op.add_column(
             sa.Column("is_orphaned", sa.Boolean, default=False, 
nullable=False, server_default="0")
         )
-    with Session(bind=op.get_bind()) as session:
-        session.execute(
-            sa.text(
-                "update dataset set is_orphaned = true "
-                "where exists (select 1 from asset_active "
-                "where dataset.name = asset_active.name and dataset.uri = 
asset_active.uri)"
-            )
+    op.execute(
+        sa.text(
+            "update dataset set is_orphaned = true "
+            "where exists (select 1 from asset_active "
+            "where dataset.name = asset_active.name and dataset.uri = 
asset_active.uri)"

Review Comment:
   nit: Does `op.execute` need `sa.text`? I think it could directly take the 
query.



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