zach-overflow commented on code in PR #59239:
URL: https://github.com/apache/airflow/pull/59239#discussion_r2637195396


##########
airflow-core/src/airflow/migrations/versions/0015_2_9_0_update_trigger_kwargs_type.py:
##########
@@ -78,16 +67,12 @@ def downgrade():
         ------------
         """)
         )
-    else:
-        session = get_session()
-        try:
-            for trigger in 
session.query(Trigger).options(lazyload(Trigger.task_instance)):
-                trigger.encrypted_kwargs = 
json.dumps(BaseSerialization.serialize(trigger.kwargs))

Review Comment:
   This was causing downgrade [test failures in 
CI](https://github.com/apache/airflow/actions/runs/20346147416/job/58459619112?pr=59239)
 since it referred directly to the ORM `Trigger` class, which still has the 
`trigger_queue` attribute present, despite the column's removal in my new 
migration script's `downgrade` function. Not sure if there is a better 
workaround for this, but let me know. I'm not an alembic expert, but my 
understanding is that it generally is not recommended to directly reference ORM 
classes within alembic migration scripts pretty much for this exact described 
reason.



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